Warning sur les constructeurs de classes

Re: Warning sur les constructeurs de classes

by Ronan Boulic -
Number of replies: 0

voici ce que dit la documentation sur cette option:

-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.
ça correspond à votre code qui a une inversion dans l'ordre d'initialisation des attributs par rapport à l'ordre de leur déclaration.