std::meta::is_special_member_function
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
#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) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/cpp/meta/is_special_member_function