better-enums icon indicating copy to clipboard operation
better-enums copied to clipboard

Eclipst CDT complains about class Enum's default ctor

Open eyalroz opened this issue 9 years ago • 0 comments

Eclipst CDT complains about the default constructor for class Enum - it gives a warning about the lack of explicit initialization of all data members.

Assuming no negative reprecussions, I suggest replacing this:

#ifndef BETTER_ENUMS_DEFAULT_CONSTRUCTOR
#   define BETTER_ENUMS_DEFAULT_CONSTRUCTOR(Enum)                              \
      private:                                                                 \
        Enum() { }
#endif

with this:

#ifndef BETTER_ENUMS_DEFAULT_CONSTRUCTOR
#   define BETTER_ENUMS_DEFAULT_CONSTRUCTOR(Enum)                              \
      private:                                                                 \
        Enum() : _value() { }
#endif

i.e. explicitly default-initializing the _value() field.

eyalroz avatar Aug 15 '16 09:08 eyalroz