Namespaces
Variants

std::meta::has_template_arguments

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

If r represents an entity produced by substituting template arguments into a function template, variable template, class template, or alias template, returns true. Otherwise returns false.

Parameters

r - a reflection value

Return value

true if r represents an entity instantiated from a template, otherwise false.

Notes

If has_template_arguments(r) is true, the functions std::meta::template_of and std::meta::template_arguments_of return its template and template arguments respectively.

Example

#include <meta>
#include <string>
#include <vector>

static_assert(has_template_arguments(^^std::vector<int>));
static_assert(!has_template_arguments(^^std::string));
static_assert(has_template_arguments(std::meta::dealias(^^std::string)));

int main() {}

See also

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