std::meta::operator_of
Defined in header <meta> | ||
|---|---|---|
consteval std::meta::operators operator_of( std::meta::info r ); | (since C++26) |
Returns the value of the enumerator from std::meta::operators whose corresponding operator-function-id is the unqualified name of the entity represented by r.
Parameters
| r | - | a reflection value |
Return value
The value of the enumerator.
Exceptions
std::meta::exception if r does not represent an operator function or operator function template.
Example
#include <meta>
struct S
{
S& operator+=(int);
};
static_assert(operator_of(^^S::operator+=) == std::meta::op_plus_equals);
// constexpr auto x_x = operator_of(^^S); // throws at compile-time:
// reflection does not represent
// operator function (template)
int main() {}
See also
|
(C++26) | constants that identify overloadable operators (enum) |
|
(C++26)(C++26) | converts a meta::operators enumerator to its symbolic name (function) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/cpp/meta/operator_of