25 lines
701 B
Plaintext
25 lines
701 B
Plaintext
[#nullary_metafunction]
|
|
[section Nullary template metafunction]
|
|
|
|
A ['nullary template metafuncion] is a [link metafunction template metafunction]
|
|
taking 0 arguments. It is a type with a nested type called `type`, which is the
|
|
return value of the nullary metafunction. For example:
|
|
|
|
struct always13
|
|
{
|
|
using type = std::integral_constant<int, 13>;
|
|
};
|
|
|
|
This metafunction is called `always13`. It is a nullary metafunction, because it
|
|
takes no arguments. It always returns `std::integral_constant<int, 13>`.
|
|
|
|
To call this metafunction, one has to access its `::type`. For example:
|
|
|
|
always13::type
|
|
|
|
The above example calls the metafunction to get
|
|
`std::integral_constant<int, 13>`.
|
|
|
|
[endsect]
|
|
|