why i get [-Wreorder] warnings?
"warning: 'property<bool>::setf' will be initialized after [-Wreorder]"
and i have much more. but i don't know why these warnings. can anyone advice me?
Can you show some relevant code? It sounds like you're inside a constructor, and your initialization list is initializing things in a different order than what they're defined at.
Members of a class are initialized in the order that they are declared inside the class definition. If you don't do it in order, the program will still try to initialize earlier member variables before initializing the one you're actually trying to initialize. To prevent this weird behavior, always make sure your order of member declaration matches the order in the initialization list.
1 2 3 4 5 6 7 8 9 10 11
class A {
A()
: a(3), // 1st
b(a) // 2nd
{}
int a; // 1st
int b; // 2nd
};
int main() {}
for be optional argument.
and these problem was, too, to do with my IDE that came with the GCC compiler. so i did the change and now no warnings.
thanks for all