Spec-Zone.ru › C++

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

is_function
(C++26)
checks if reflection represents a function
(function)
is_conversion_function
(C++26)
checks if reflection represents a conversion function
(function)
is_constructoris_default_constructoris_copy_constructoris_move_constructor
(C++26)(C++26)(C++26)(C++26)
checks if the reflected entity is a constructor of this kind
(function)
is_destructor
(C++26)
checks if the reflected entity is a destructor
(function)
is_assignmentis_copy_assignmentis_move_assignment
(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

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API