lundi 25 septembre 2017

Is enum class type or not in C++?

I read about enumeration declaration in C++ using cppreference.

Then I have made Enum class and check whether it is a class type using std::is_class.

#include <iostream>

enum class Enum 
{
    red = 1, blue, green
};

int main() 
{
    std::cout << std::boolalpha;
    std::cout << std::is_class<Enum>::value << '\n';
}

Then I compiled and ran into GCC compiler, it's give false output.

So Is enum class type or not? If enum class type then why I getting false output?

Aucun commentaire:

Enregistrer un commentaire