std::meta::is_operator_function
From cppreference.com
| Defined in header <meta>
|
||
consteval bool is_operator_function( std::meta::info r );
|
(since C++26) | |
Returns true if r represents a function that is an operator function (operator overload). Otherwise returns false.
Parameters
| r | - | a reflection value |
Return value
true if r represents an operator function; otherwise false.
Example
Run this code
#include <meta>
struct S
{
void foo();
operator int();
S& operator()(int);
};
static_assert(!is_operator_function(^^S::foo));
static_assert(!is_operator_function(^^S::operator int));
static_assert(is_operator_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) |
| checks if reflected entity is an operator function template (function) |