description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | |||
---|---|---|---|---|---|---|---|---|
Learn more about: is_abstract Class | is_abstract Class | 11/04/2016 |
|
| 8867f660-3434-404c-ba90-c26607a5e0d2 |
Tests if type is abstract class.
template <classTy> structis_abstract;
Ty
The type to query.
An instance of the type predicate holds true if the type Ty is a class that has at least one pure virtual function, otherwise it holds false.
// std__type_traits__is_abstract.cpp// compile with: /EHsc #include<type_traits> #include<iostream>structtrivial { int val; }; structabstract { virtualintval() = 0; }; intmain() { std::cout << "is_abstract<trivial> == " << std::boolalpha << std::is_abstract<trivial>::value << std::endl; std::cout << "is_abstract<abstract> == " << std::boolalpha << std::is_abstract<abstract>::value << std::endl; return (0); }
is_abstract<trivial> == false is_abstract<abstract> == true
Header: <type_traits>
Namespace: std