boxed_value.qbk 681 B

123456789101112131415161718192021
  1. [#boxed_value]
  2. [section Boxed value]
  3. A ['boxed value] is a type representing a constant value. It has a public static
  4. `const` or `constexpr` member called `value`. The class represents that value as
  5. a type, so it can be manipulated by [link metafunction template metafunction]s.
  6. It has to be a [link metaprogramming_value template metaprogramming value].
  7. For example the following `struct` represents the `true` value of type `bool`:
  8. struct true_type
  9. {
  10. static constexpr bool value = true;
  11. using type = true_type;
  12. };
  13. The `value` member is the wrapped value. `true_type::type` is an alias of
  14. `true_type` which makes it a template metaprogramming value.
  15. [endsect]