Namespaces
Variants

std::meta::is_operator_function_template

From cppreference.com
< cpp | meta
 
 
 
Reflection library
 
Reflection types and queries
Type properties
Type property queries
 
Defined in header <meta>
consteval bool is_operator_function_template( std::meta::info r );
(since C++26)

Returns true if r represents an operator function template. Otherwise returns false.

Parameters

r - a reflection value

Return value

true if r represents an operator function template; otherwise false.

Example

#include <meta>

struct S
{
    // conversion function
    operator int();

    // conversion function template
    template<typename T>
    operator float();

    // operator function
    int operator[](int);

    // operator function template
    template<typename T>
    int operator+=(const S&);
};
static_assert(!is_operator_function_template(^^S::operator int));
static_assert(!is_operator_function_template(^^S::operator float));
static_assert(!is_operator_function_template(^^S::operator[]));
static_assert( is_operator_function_template(^^S::operator+=));

bool operator+ (S, S);
static_assert(!is_operator_function_template(^^operator+));

template <typename T>
bool operator- (S, S);
static_assert(is_operator_function_template(^^operator-));

int main() {}

See also

checks if reflection represents a function
(function) [edit]
checks if reflected entity is a template
(function) [edit]
checks if reflection represents an operator overload
(function) [edit]
checks if reflected entity is a function template
(function) [edit]
checks if reflected entity is a conversion function template
(function) [edit]
Morty Proxy This is a proxified and sanitized view of the page, visit original site.