I have an initialization list:
For some reason I get a warning "c will be initialized after b". Why?Code:class foo : a(), b(), c() {
I have an initialization list:
For some reason I get a warning "c will be initialized after b". Why?Code:class foo : a(), b(), c() {
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge
That order probably differs from the order in which they are declared in the class and which determines the real order how class members are going to be initialized.
This could lead to errors if you use members of the class to initialize other members.
Code:struct X { int b; int a; X(int n): a(n), b(a) {} //a will be initialized after b which uses a's value! };
I might be wrong.
Quoted more than 1000 times (I hope).Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge
Just missed this one, I take it?
Use of initializer list - is it defined?