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_abstract is_abstract] |
| 9 | template <class T> |
| 10 | struct is_abstract : public __tof {}; |
| 11 | |
| 12 | __inherit If T is a (possibly cv-qualified) abstract type then inherits from |
| 13 | __true_type, otherwise inherits from __false_type. |
| 14 | |
| 15 | __std_ref 10.3. |
| 16 | |
| 17 | __header ` #include <boost/type_traits/is_abstract.hpp>` or ` #include <boost/type_traits.hpp>` |
| 18 | |
| 19 | __compat The compiler must support DR337 (as of April 2005: GCC 3.4, VC++ 7.1 (and later), |
| 20 | Intel C++ 7 (and later), and Comeau 4.3.2). |
| 21 | Otherwise behaves the same as __is_polymorphic; |
| 22 | this is the "safe fallback position" for which polymorphic types are always |
| 23 | regarded as potentially abstract. The macro BOOST_NO_IS_ABSTRACT is used to |
| 24 | signify that the implementation is buggy, users should check for this in their |
| 25 | own code if the "safe fallback" is not suitable for their particular use-case. |
| 26 | |
| 27 | __examples |
| 28 | |
| 29 | [:Given: `class abc{ virtual ~abc() = 0; };` ] |
| 30 | |
| 31 | [:`is_abstract<abc>` inherits from `__true_type`.] |
| 32 | |
| 33 | [:`is_abstract<abc>::type` is the type `__true_type`.] |
| 34 | |
| 35 | [:`is_abstract<abc const>::value` is an integral constant |
| 36 | expression that evaluates to /true/.] |
| 37 | |
| 38 | [:`is_abstract<T>::value_type` is the type `bool`.] |
| 39 | |
| 40 | [endsect] |
| 41 | |