std::meta::is_function_template
From cppreference.com
| Defined in header <meta>
|
||
consteval bool is_function_template( std::meta::info r );
|
(since C++26) | |
Returns true if r represents a function template. Otherwise returns false.
Parameters
| r | - | a reflection value |
Return value
true if r represents a function template; otherwise false.
Example
Run this code
#include <meta>
// function
void fun1();
static_assert(!std::meta::is_template(^^fun1));
// function template
template<int>
void fun2();
static_assert(std::meta::is_template(^^fun2));
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_template(^^S::operator int));
static_assert(std::meta::is_template(^^S::operator float));
static_assert(!std::meta::is_template(^^S::operator[]));
static_assert(std::meta::is_template(^^S::operator+=));
int main() {}
See also
(C++26) |
checks if reflection represents a function (function) |
(C++26) |
checks if reflected entity is a template (function) |
| checks if reflected entity is a conversion function template (function) | |
| checks if reflected entity is an operator function template (function) | |
(C++26) |
checks if reflected entity is a constructor template (function) |