enum class object default value

Viewed 38

We have an enum class in the code e.g.

namespace mynamespace {
     enum class myType
         {
             a,
             b,
             c,
             d
         };
      ..
 }

In another file, I am creating an object of this class as below:

   mynamespace::mytype  mType;

What I observed is that in my previous builds mType was getting assigned default value of 'a' after execution of above line.

However in my latest compilations, it is not the case and mType is null.

I am curious to know what could have triggered this change.

Is it related to GCC version or should I look for any changes in my compilation options?

0 Answers
Related