Spec-Zone.ru › C++

std::meta::is_conversion_function_template

Defined in header <meta>
consteval bool is_conversion_function_template( std::meta::info r );
(since C++26)

Returns true if r represents a conversion function template. Otherwise returns false.

Parameters

r - a reflection value

Return value

true if r represents a conversion function; 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( std::meta::is_conversion_function(^^S::operator int));
static_assert(!std::meta::is_conversion_function_template(^^S::operator int));
static_assert(!std::meta::is_conversion_function(^^S::operator float));
static_assert( std::meta::is_conversion_function_template(^^S::operator float));
static_assert(!std::meta::is_operator_function(^^S::operator float));
static_assert(!std::meta::is_operator_function_template(^^S::operator float));
static_assert(!std::meta::is_conversion_function_template(^^S::operator[]));
static_assert(!std::meta::is_conversion_function_template(^^S::operator+=));

int main() {}

See also

is_conversion_function
(C++26)
checks if reflection represents a conversion function
(function)
is_function_template
(C++26)
checks if reflected entity is a function template
(function)
is_template
(C++26)
checks if reflected entity is a template
(function)
is_operator_function
(C++26)
checks if reflection represents an operator overload
(function)
is_operator_function_template
(C++26)
checks if reflected entity is an operator function template
(function)

© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/cpp/meta/is_conversion_function_template

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API