...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
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 };
andenum class fruit { apple, orange };
is_unscoped_enum<color>
inherits fromtrue_type
.
is_unscoped_enum<fruit>
inherits fromfalse_type
.
is_unscoped_enum<color const>::type
is the typetrue_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 typebool
.