std::meta::is_deleted

来自cppreference.com
< cpp | meta
 
 
 
反射库
 
在标头 <meta> 定义
consteval bool is_deleted( std::meta::info r );
(C++26 起)

如果 r 表示弃置函数,则返回 true,否则返回 false

参数

r - 一个反射值

返回值

如果 r 表示弃置函数,则为 true,否则为 false

示例

#include <meta>

struct Base
{
    bool operator==(const Base&) const = delete;
};

struct Derived : public Base
{
    bool operator==(const Derived&) const = default; // 隐式弃置
};

static_assert(std::meta::is_deleted(^^Base::operator==));
static_assert(std::meta::is_deleted(^^Derived::operator==));

int main() {}

参阅

检查反射是否表示函数
(函数) [编辑]
检查反射是否表示用户提供的函数
(函数) [编辑]
Morty Proxy This is a proxified and sanitized view of the page, visit original site.