Boost logo

Boost :

From: Seweryn Habdank-Wojewódzki (shw_at_[hidden])
Date: 2007-06-22 13:43:11


Hi!

> wouldn't it help if you just add a template declaration beforehand?
>
> template < typename T > struct Bar;
>
> or sth like that.

Of course it helps, but this is not the point.

Maybe other explanation.

Let's observe the class:

class Foo {
public:
        void foo() {
                a = 100;
        }
private:
        int a;
};

Above there is no problem for the compiler to see field "a", even if it is
below first usage. This code is equivalent to:

class Foo {
private:
        int a;
public:
        void foo() {
                a = 100;
        }
};

Compiler by default makes such a "sorting".

If you do the same with typedef you will fail, due to standard demand and
compilers implementation. But, I am looking if this demand is really strong.

So I am looking for a implementation (the code) where really e.g. sequence of
typedefs or other things will have an influence on the compilation process,
not only by forcing by standard or compiler :-).

This is the point why I am looking on metaprograms, because, there are some
important stuff regarding to the solving values of sizeof(), or where the
sequence of typedefs can influence on analysis (identyfication) of the type.

Such a "tricky" code can change resolution like in STD item 6.8  Ambiguity
resolution [stmt.ambig] or 8.2  Ambiguity resolution [dcl.ambig.res].

If such a code do not exists there is e question why typedef have to be placed
in proper order.

Regards.

-- 
|\/\/|   Seweryn Habdank-Wojewódzki
 \/\/ 

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk