Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Nullary template metafunction

A nullary template metafuncion is a 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>.


PrevUpHomeNext