Namespaces
Variants
Views
Actions

std::is_polymorphic

From cppreference.com
< cpp‎ | types
Revision as of 09:47, 26 October 2011 by P12 (Talk | contribs)

Template:cpp/types/sidebar Template:ddcl list begin <tr class="t-dsc-header">

<td>
Defined in header <type_traits>
</td>

<td></td> <td></td> </tr> <tr class="t-dcl ">

<td >
template< class T >
struct is_polymorphic;
</td>

<td class="t-dcl-nopad"> </td> <td > Template:mark c++11 feature </td> </tr> Template:ddcl list end

If T is a polymorphic class (that is, a class that declares or inherits at least one 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 a polymorphic 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

Only polymorphic classes contain hidden RTTI information which makes it possible to examine and convert them with dynamic_cast.

Example

Template:example cpp

See also

(C++11)
checks if a type is a non-union class type
(class template) [edit]
checks if a type is an abstract class type
(class template) [edit]