std::meta::is_pure_virtual
Defined in header <meta> | ||
|---|---|---|
consteval bool is_pure_virtual( std::meta::info r ); | (since C++26) |
Returns true if r represents a member function that is pure virtual. Otherwise returns false.
Parameters
| r | - | a reflection value |
Return value
true if r represents a member function that is pure virtual; otherwise false.
Example
#include <meta>
struct Base
{
virtual void f() = 0;
};
struct Derived : public Base
{
void f() = 0; // overrides Base::f
virtual void g();
};
static_assert(std::meta::is_pure_virtual(^^Base::f));
static_assert(std::meta::is_pure_virtual(^^Derived::f));
static_assert(!std::meta::is_pure_virtual(^^Derived::g));
int main() {}
See also
|
(C++26) | checks if reflection represents a virtual member function or virtual base class (function) |
|
(C++26) | checks if reflection represents a member function that overrides another member function (function) |
|
(C++26) | checks if reflection represents a function (function) |
|
(C++11) | checks if a type is an abstract class type (class template) |
|
(C++26) | checks if reflected type is an abstract class type (function) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/cpp/meta/is_pure_virtual