by red floyd <no.spam@[EMAIL PROTECTED]
>
May 7, 2008 at 04:35 PM
thucdat@[EMAIL PROTECTED]
wrote:
> Visual Studio C++ compiles the following:
>
>
>
> class someclass {
> //
> };
>
> void somefunction(someclass &) {
> //
> }
>
> int main() {
> somefunction(someclass());
> return 0;
> }
>
>
>
> But Dev-C++ (Bloodshed) and g++ don't. I wonder if Visual Studio C++
> is smarter here.
No, Bloodshed (which uses g++) and g++ are correct. You can't bind a
tem****ary to a non-const ref. If you turn of MS extensions (I think
it's /Za) VStudio will also properly generate an error.