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

This is the documentation for a snapshot of the develop branch, built from commit 36319504d5.
PrevUpHomeNext

is_scoped_enum

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

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

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

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

Examples:

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

is_scoped_enum<color> inherits from true_type.

is_scoped_enum<fruit> inherits from false_type.

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

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

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

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

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


PrevUpHomeNext