How screwed up am I? C++ offers two typecast styles. For example, to
typecast x to an int I can do (int)x or int(x). So take a look at the
following do-nothing example:
void fcn()
{
int x, y; // Okay
x; // Okay
y = int(x); // Okay
int(x); // NOT Okay!!!!!
(int)x; // Okay
}
The compiler obviously treates int(x) as a declaration, as it should.
However, what if I want (for whatever bizarre reason) to have a non-side
effect statement consisting only of a C++ typecast? I can have such a
statement for C typecasts and every other form of expression I know of, so
why should this be an exception? It reminds me of the early days of C where
the compound operators were =+ =- =* etc. instead of the current += -+ *=
etc. Since the problem with these was seen quickly, they were changed. Oh
well, I'm probably just missing something, but any thoughts are welcome.
Thanks,
Ray