std::meta::reflect_function
From cppreference.com
| 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
| This section is incomplete Reason: no example |
See also
| This section is incomplete |