nullary_metafunction.qbk 701 B

123456789101112131415161718192021222324
  1. [#nullary_metafunction]
  2. [section Nullary template metafunction]
  3. A ['nullary template metafuncion] is a [link metafunction template metafunction]
  4. taking 0 arguments. It is a type with a nested type called `type`, which is the
  5. return value of the nullary metafunction. For example:
  6. struct always13
  7. {
  8. using type = std::integral_constant<int, 13>;
  9. };
  10. This metafunction is called `always13`. It is a nullary metafunction, because it
  11. takes no arguments. It always returns `std::integral_constant<int, 13>`.
  12. To call this metafunction, one has to access its `::type`. For example:
  13. always13::type
  14. The above example calls the metafunction to get
  15. `std::integral_constant<int, 13>`.
  16. [endsect]