std::meta::is_explicit
From cppreference.com
| Defined in header <meta>
|
||
consteval bool is_explicit( std::meta::info r );
|
(since C++26) | |
Returns true if r represents an explicit constructor or conversion function. Otherwise returns false.
Parameters
| r | - | a reflection value |
Return value
true if r represents a member function that is declared explicit; otherwise false.
Notes
If r does not represent a function, the result is false. In particular, the result is false if r represents a function template.
Example
Run this code
#include <meta>
struct A {
explicit operator bool() const;
template<class T>
explicit(^^T == ^^void) operator T*() const;
};
static_assert(std::meta::is_explicit(^^A::operator bool));
static_assert(std::meta::is_explicit(^^A::operator void*));
static_assert(!std::meta::is_explicit(^^A::operator int*));
See also
(C++26) |
checks if reflection represents a function (function) |