« first day (377 days earlier)      last day (4564 days later) » 

11:00 PM
> a class with a private and undefined copy constructor (and no move constructors)
Do you mean no user-defined move constructors?
 
yeah. I forgot one will be declared implicitly, but it will be deleted if there is a private user declared copy constructor
so for the purpose of the question it doesn't really matter
 
> I remember it could be useful to allow callers of a function use the returned object, but that they are not able to copy the value and store it somewhere.
Bind to a const-ref...
 
I view that as being different
you cannot pull that const reference somewhere else. it's bound to the local scope and will disappear when control leaves that scope
 
I have an idea.
 
@JohannesSchaublitb f().foo() works, but I have no clue why it does.
 
11:11 PM
@JohannesSchaublitb I posted an answer.
 
Base has a public copy constructor
thanks for all your help folks. I'm glad you don't leave me alone!
 
@JohannesSchaublitb I don't mean to pester, but what's wrong with Howards solution?
 
@Pubby8 it has a public move constructor
 
Oh, hehe. Now I see
Why not make the function a friend?
 
Lol, I give up.
 
11:22 PM
lol
 
Got a new idea.
 
@StackedCrooked hint: I shall brace myself for all the good answers!
 
Is there a C++03 solution?
 
I already answered that question in my question xD
 
I got an idea, doubt it will work
 
11:25 PM
Ah, so it's C++11.
 
it's somewhat unfair because @Howard and @Nicolas don't know that it's a quiz :(
 
I was hoping that binding the return value to const ref would convince the compiler that it doesn't need a copy constructor.
But it did not change its opinion no matter how hard I tried.
 
my friend wrote in his code "// on windows 64bit, int is 64bit and long is 32bit". I couldn't believe
is that comment correct?
 
I doubt it. I believe int is still 32-bit.
 
11:36 PM
Only pointers are 64
 
on windows 64 bit, the only 64 bit var is long long
 
and that
 
I said so too
but he didn't believe me, saying "I found that statement on stackoverflow"
 
I've heard the rumor before though. But it's just a rumor
 
Windows has LLP64- that is, only pointers are 64bit
int and long are 32bit, and long long is 64bit, the same as 32bit
 
11:37 PM
not all pointers are 64 bit, some are psudo-struct-hybrid-things
 
Does anyone think this is useful? (Fixed-width integers that are defined through tmp instead of predefined compiler stuff.)
 
then they're not pointers
@StackedCrooked Are you sure that will compile when both int and long are the same size?
 
Hah!
Never tested it.
 
DeadMG: virtual member function pointers are oddball things. Are they not pointers in your book?
 
no member function pointer is a pointer
usually they're at least two pointers
 
11:40 PM
DeadMG: alright then.
 
no member function pointer is a pointer. or said in a different way, a member function pointer is not a pointer (to ensure I didn't misread your statement)
 
why do you think there's no member function pointer -> void* conversion?
or check the sizeof() - it's way bigger
 
@DeadMG Seems to work fine.
 
I was thinking C++ pointers, but once I think of it at a hardware level, the truth of what your saying becomes obvious
 
@MooingDuck That's what happens any time I say anything, ever.
 
11:42 PM
Can I tell ideone to compile as 32-bit?
 
It's a little short on compiler options
 
you can't pass command line or anything
 
error: ISO C++ does not support 'long long'
 
ideone can compile as C++11
 
@JohannesSchaublitb You're not using some unorthodox definition of the words 'value' or 'return', are you?
 
11:50 PM
I can't register at ideone because it doesn't want anything but numbers and letters in my email address. My email has underscores :(
well now it works. Wonder what was wrong
 

« first day (377 days earlier)      last day (4564 days later) »