Speclib  0.1.2
The library for writing better CUDA libraries
Type Printing

A system for printing the name of types. More...

Functions

template<typename T >
constexpr const char * sp::getTypeName ()
 Get a type-encoded string representing the given type. More...
 

Variables

template<typename T >
constexpr const char * sp::type_name_v = getTypeName<T>()
 Memoized result of getTypeName() More...
 

Detailed Description

A system for printing the name of types.

This is quite useful for making nice errors in template code, because you can print out the names of types used as template parameters.

Specialise TypeName<T> for your new type to add support for user-defined types.

Function Documentation

◆ getTypeName()

template<typename T >
constexpr const char * sp::getTypeName ( )
constexpr

Get a type-encoded string representing the given type.

Variable Documentation

◆ type_name_v

template<typename T >
constexpr const char* sp::type_name_v = getTypeName<T>()
constexpr

Memoized result of getTypeName()