Hi, here is a tea question:

the warning in subject is "class::constname will be initialized after const type class::secondconstname when initialized here [the initialization row]"

Situation:
let's suppose that we declare two constant variables in a class
Qt Code:
  1. class myCuriousClass{
  2. private:
  3. const int constant1;
  4. const int constant2;
  5. public:
  6. myCuriousClass();
  7. };
To copy to clipboard, switch view to plain text mode 
and then we valorize them as expected within a class: by the constructor
Qt Code:
  1. myCuriousClass::myCuriousClass()
  2. :constant2(2),constant1(1)
  3. {
  4. //nothing smart to do here
  5. }
To copy to clipboard, switch view to plain text mode 
the fact that we initialized them in reversed order than we declared them makes the compiler complain
myCuriousClass::constant1 will be initialized before const int myCuriousClass::constant2 when initialized here (row 3 of the second piece of code)
So the question is, what is the problem if I reverse the order? Why was dedicated a warning to this situation?

PS: for this test I used a MinGW compiler.

Thank you for your attention