Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Boxed value

A boxed value is a type representing a constant value. It has a public static const or constexpr member called value. The class represents that value as a type, so it can be manipulated by template metafunctions. It has to be a template metaprogramming value.

For example the following struct represents the true value of type bool:

struct true_type
{
  static constexpr bool value = true;
  using type = true_type;
};

The value member is the wrapped value. true_type::type is an alias of true_type which makes it a template metaprogramming value.


PrevUpHomeNext