std::meta::is_special_member_function
From cppreference.com
| Defined in header <meta>
|
||
consteval bool is_special_member_function( std::meta::info r );
|
(since C++26) | |
Returns true if r represents a special member function (that is either, a default/copy/move constructor, a copy/move assignment operator or a (possibly prospective) destructor). Otherwise returns false.
Parameters
| r | - | a reflection value |
Return value
true if r represents a special member function; otherwise false.
Example
Run this code
#include <meta>
struct S
{
~S();
operator int();
S& operator()(int);
};
static_assert(is_special_member_function(^^S::~S));
static_assert(!is_special_member_function(^^S::operator int));
static_assert(!is_special_member_function(^^S::operator()));
int main() {}
See also
(C++26) |
checks if reflection represents a function (function) |
(C++26) |
checks if reflection represents a conversion function (function) |
(C++26)(C++26)(C++26)(C++26) |
checks if the reflected entity is a constructor of this kind (function) |
(C++26) |
checks if the reflected entity is a destructor (function) |
(C++26)(C++26)(C++26) |
checks if the reflected entity is an assignment operator of this kind (function) |