Re: using a class inside a class.
On Apr 29, 6:09 pm, phil.pellouch...@gmail.com wrote:
On Apr 29, 1:46 am, James Kanze <james.ka...@gmail.com> wrote:
[...]
Ahha yes its not C++0x Concepts, its old style concept
checking. Theres bound to be an option to turn that off.
Probbably a macro somewhere
It's off by default (but I always turn it on). To get it, you
need to define _GLIBCXX_CONCEPT_CHECKS, i.e. specify the option
-D_GLIBCXX_CONCEPT_CHECKS.
[...]
did the default behavior change in gcc 4.3?
I don't know. The latest version I currently have installed
here is 4.1.0. (I really should install 4.3, but I haven't had
time as yet.)
I know that the g++ people are implementing a preliminary
version of concepts, which will change the way this is handled.
i seem to get it by default; and I don't know how to turn it
off. I did try doing a
#undefine _GLIBCXX_CONCEPT_CHECKS
at the top of the sample app:
---- cut here ----
#undef _GLIBCXX_CONCEPT_CHECKS
#include <list>
class CFoo
{
private:
std::list<CFoo> m_children;
};
int main()
{
CFoo Foo;
}
---- cut here ----
But i still get the same error. I would love to be able to
simply disable it if I could...
Just compile with an older version of g++. But why? It will be
a required error in the future, so you won't be able to upgrade
compilers, or us any other more recent compiler, if you do so.
The code is illegal today; it just happens to work with some
compilers, by chance, but even then, the compiler vendor doesn't
guarantee it.
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34