Destructors, const structs, and opEquals

so so at so.do
Sat Dec 4 04:50:13 PST 2010


> I'm 99.99% certain that it's perfectly legal to pass a temporary to a  
> function
> that takes a const T& and that it's in the standard

Oh that is right, but both are different things.

Say, when you have:

T fun() {...}
void bar(const T&) {...}

bar(fun()) // 1. this is perfectly legal.
const T& a = fun(); // 2. not legal, but still  you can do it on some  
compilers.

What Don's example is all about as far as i can tell is that D can't do  
the first one, somehow.

-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/


More information about the Digitalmars-d mailing list