aantron / better-enums

C++ compile-time enum to string, iteration, in a single header file
http://aantron.github.io/better-enums
BSD 2-Clause "Simplified" License
1.67k stars 173 forks source link

Eclipst CDT complains about class Enum's default ctor #30

Open eyalroz opened 8 years ago

eyalroz commented 8 years ago

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.