declaration order of member variables in struct

John Fine johnsfine@verizon.net
Sun Aug 2 13:04:00 GMT 2009


I think Martin was asking why the usual exception to pre declaration 
doesn't apply.
In defining a class or struct, you can normally use symbols before you 
declare them.
I don't know what makes this example different.

Michael Eager wrote:
> Martin Ettl wrote:
>>
>> template <int N, int Low=1, int Upp=N> struct Root {
>>   static const int  ret  = 
>> Root<N,(down?Low:mean+1),(down?mean:Upp)>::ret;
>                                      ^^^^     ^^^^     ^^^^ ^^^^
>
> Neither down nor mean are defined before they are referenced.
>
> ...
> Each symbol (variable or type) in C/C++ must be declared before it is 
> used.
>
>



More information about the Gcc-help mailing list