Shaka Player Embedded
Static Public Member Functions | List of all members
shaka::TypeName< T, typename > Struct Template Reference

#include <names.h>

Static Public Member Functions

static std::string name ()
 

Detailed Description

template<typename T, typename = void>
struct shaka::TypeName< T, typename >

Contains a single method |name| that returns a string for the name of the type. For custom types, it requires a static method |name| to exist on the type T. This contains overrides for built-in types.

The second template parameter should always be void. This is to allow partial specialization for numbers. When instantiating a template, the compiler first gets the default as specified in the base definition. Then it checks each specialization to see if it can infer arguments that will match that specialization.

So when passing (int), it will expand to (int, void), then check each specialization. When it gets to the one for numbers, it will check the enable_if_t; the enable_if_t will result in void if the first type is a number, or an error if not. This will cause that specialization to be used if T is a number and will be ignored if it is not a number.

Definition at line 47 of file names.h.

Member Function Documentation

§ name()

template<typename T, typename = void>
static std::string shaka::TypeName< T, typename >::name ( )
inlinestatic

Definition at line 48 of file names.h.


The documentation for this struct was generated from the following file: