Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

is_unscoped_enum

template<class T>
struct is_unscoped_enum
    : true_type-or-false_type { };

Inherits: If T is a (possibly cv-qualified) unscoped enumeration type (enum but not enum class), then inherits from true_type, otherwise inherits from false_type.

Header: #include <boost/type_traits/is_unscoped_enum.hpp>

Compiler Compatibility: All current compilers are supported by this trait.

Examples:

Given: enum color { red, blue }; and enum class fruit { apple, orange };

is_unscoped_enum<color> inherits from true_type.

is_unscoped_enum<fruit> inherits from false_type.

is_unscoped_enum<color const>::type is the type true_type.

is_unscoped_enum<color>::value is an integral constant expression that evaluates to true.

is_unscoped_enum<color&>::value is an integral constant expression that evaluates to false.

is_unscoped_enum<color*>::value is an integral constant expression that evaluates to false.

is_unscoped_enum<T>::value_type is the type bool.


PrevUpHomeNext