std::is_abstract
From cppreference.com
Template:cpp/types/sidebar Template:ddcl list begin <tr class="t-dsc-header">
<td>Defined in header
</td>
<type_traits>
<td></td> <td></td> </tr> <tr class="t-dcl ">
<td >template< class T >
struct is_abstract;
</td>
struct is_abstract;
<td class="t-dcl-nopad"> </td> <td > Template:mark c++11 feature </td> </tr> Template:ddcl list end
If T
is an abstract class (that is, a class that declares or inherits at least one pure virtual function), provides the member constant value
equal Template:cpp. For any other type, value
is Template:cpp.
Contents |
Inherited from std::integral_constant
Member constants
value [static] |
true if T is an abstract class type , false otherwise (public static member constant) |
Member functions
operator bool |
converts the object to bool, returns value (public member function) |
operator() (C++14) |
returns value (public member function) |
Member types
Type | Definition |
value_type
|
bool |
type
|
std::integral_constant<bool, value> |
Notes
Abstract classes may only be used as base classes; no objects of an abstract class type can be created except in form of base class subobjects.
An abstract class may be derived from a class that is not abstract, and a pure virtual function may override a virtual function that is not pure.
Example
See also
(C++11) |
checks if a type is a non-union class type (class template) |
(C++11) |
checks if a type is a polymorphic class type (class template) |