¿Cuál es el punto de g ++ -Wreorder?
La opción g ++ -Wall incluye -Wreorder. Lo que hace esta opción se describe a continuación. No es obvio para mí por qué a alguien le importaría (especialmente lo suficiente como para activarlo de forma predeterminada en -Wall).
-Wreorder (C++ only) Warn when the order of member initializers given in the code does not match the order in which they must be executed. For instance: struct A { int i; int j; A(): j (0), i (1) { } }; The compiler will rearrange the member initializers for i and j to match the declaration order of the members, emit-ting a warning to that effect. This warning is enabled by -Wall.