Namespaces
Variants

std::meta::reflect_function

From cppreference.com
< cpp | meta
Defined in header <meta>
template< class T >
consteval std::meta::info reflect_function( T& fn );
(since C++26)

Returns a reflection that represents the function referred to by fn.

The program is ill-formed if T is not a function type.

Parameters

r - an lvalue that refers to a function

Return value

A reflection that represents a function.

Exceptions

Throws std::meta::exception unless a glvalue constant expression E that refers to the function fn is a valid template argument for a template parameter of type T&.

Notes

This function can be used to create a reflection of a function whose name is overloaded.

int f(char); // #1
int f(long); // #2

constexpr auto rf1 = ^^f; // error: cannot reflect an overload set
constexpr auto rf2 = std::meta::reflect_function<int(char)>(f); // OK, rf2 represents overload #1

Example

See also

returns a reflection representing a value or template parameter object, suitable for use as a constant template argument
(function template) [edit]
returns a reflection representing an object, suitable for use as a constant template argument
(function template) [edit]
substitutes the given arguments in the given template, and returns a reflection of the result of substitution
(function template) [edit]