Could you explain why that needs another parentheses pair?
O_o
I don't think I can without going to some extremely technical places.
I think can show you without much difficulty.
Code:
int main()
{
{
int s1(); /*!*/ // Declare a function taking nothing and returning an `int' variable.
// s1 = 0; // Nope. The above is not a variable definition/declaration.
}
{
int s2(int); /*!*/ // Declare a function taking an `int' variable and returning an `int' variable.
// s2 = 0; // Nope. The above is not a variable definition/declaration.
}
{
int s3(int()); /*!*/ // Declare a function taking a function pointer (The function provided would need to be a function taking nothing and returning an `int' variable.) variable and returning an `int' variable.
// s3 = 0; // Nope. The above is not a variable definition/declaration.
}
{
int s4((int())); // Declare a variable of `int' type and initialize that variable to the same variable as a default constructed variable of `int' type.
s4 = 0; // Fine. The above is a variable definition/declaration. The extra parentheses prevent the call, the default `int' constructor is called, from looking like a declaration.
}
{
// sizeof(int()); // Nope. The `sizeof' operator can not be used on the result of calling a function. As I describe above, the `int()' expression is a declaration.
}
{
sizeof((int())); // Fine. The `sizeof' operator can be used on the result of calling a function. (The default constructor for `int' type is being called.) As I describe above, the extra parentheses prevent the call from looking like a declaration.
}
}
The expression in your code is complex, but the underlying cause of the error is essentially the same as the errors shown in my example.
I'd like to give a simple explanation, but you need to keep in mind that I am glossing over a lot.
The error lines in my example look like they might be a label declaration; the standard says that anything that looks like a declaration is a declaration.
[Edit]
I've marked the relevant problem areas, from your perspective, with a '!' character.
[/Edit]
*shrug*
Yes. You find yourself in an odd corner of the C++ language.
Soma