| re: Strange consturct,
>>[color=blue][color=green]
>> CSize mySize;
>> CSize;
>> mySize;
>>
>> and I dont really understand what it does, I think my compiler just
>> throws it away.[/color]
>
> If 'CSize' is a type (which I suspect it is), then the first statement
> declares 'mySize' as an object of that type. The second statement should
> not compile. If it's a declaration, a variable name is missing. If it
> is a construction of a temporary, parentheses are missing. The third one
> is fine. It's an expression that consists of one object, an lvalue named
> 'mySize'. That expression is evaluated and the result is thrown out.
>
> So, all in all, the three statements are not part of a valid program due
> to the second statement.
>
> Victor[/color]
on MSVC second statement does compile, I checked with other classes and it
compiles, and even on fourth warning level there are no notifications. Gcc
does returns error. |