Brian Silverman | 4a2409e | 2018-08-04 23:24:02 -0700 | [diff] [blame^] | 1 | [/ |
| 2 | Copyright 2007 John Maddock. |
| 3 | Distributed under the Boost Software License, Version 1.0. |
| 4 | (See accompanying file LICENSE_1_0.txt or copy at |
| 5 | http://www.boost.org/LICENSE_1_0.txt). |
| 6 | ] |
| 7 | |
| 8 | [section:is_enum is_enum] |
| 9 | template <class T> |
| 10 | struct is_enum : public __tof {}; |
| 11 | |
| 12 | __inherit If T is a (possibly cv-qualified) enum type then inherits from __true_type, |
| 13 | otherwise inherits from __false_type. |
| 14 | |
| 15 | __std_ref 3.9.2 and 7.2. |
| 16 | |
| 17 | __header ` #include <boost/type_traits/is_enum.hpp>` or ` #include <boost/type_traits.hpp>` |
| 18 | |
| 19 | [all_compilers] |
| 20 | |
| 21 | __examples |
| 22 | |
| 23 | [:Given: `enum my_enum { one, two };` ] |
| 24 | |
| 25 | [:`is_enum<my_enum>` inherits from `__true_type`.] |
| 26 | |
| 27 | [:`is_enum<my_enum const>::type` is the type `__true_type`.] |
| 28 | |
| 29 | [:`is_enum<my_enum>::value` is an integral constant |
| 30 | expression that evaluates to /true/.] |
| 31 | |
| 32 | [:`is_enum<my_enum&>::value` is an integral constant |
| 33 | expression that evaluates to /false/.] |
| 34 | |
| 35 | [:`is_enum<my_enum*>::value` is an integral constant |
| 36 | expression that evaluates to /false/.] |
| 37 | |
| 38 | [:`is_enum<T>::value_type` is the type `bool`.] |
| 39 | |
| 40 | [endsect] |
| 41 | |