help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

2 pass compiling


From: Seweryn Habdank-Wojewódzki
Subject: 2 pass compiling
Date: Wed, 20 Jun 2007 01:43:07 -0700
User-agent: G2/1.0

Dears

I heard some theories, that "it is easy" NOT to force user to properly
order definitions in classes. And all can be done in two pass
compilation. What is "theoretically easy" - I do not see that, but I
heard such a theory.

GCC (G++) forces user to put all definitions in proper order (in my
opinion it is good), but any how what are real problems (in compiling
process) if the compiler have to "sort" definitions. For example: why
there is a problem with compilation of the code below. Of course I
know how to write proper (for gcc) code, but I wonder where are the
problem (in compiler) to allow user to write such a code.

struct A {
    typedef vector<B> vB;
    foo (vB vb){}
};

struct B {
    typedef vector <A> vA;
    foo (vA va){}
};

Especially there are possible more complicated examples of such a
graph of dependencies.

Regards.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]