Template Struct Num

Struct Documentation

template<size_t Value>
struct wrench::Num

The Num struct stores a number as a type, but also provides functionality to convert the value of the number into a numeric type at runtime or compile time. It is useful in a metaprogramming context to use as a type, but also when the numeric value of the type is required. It works better with variadic templates than using a raw numeric literal.

Template Parameters
  • Value: The value of the number.

Public Functions

constexpr operator size_t() const noexcept

Conversion to size_t so that the number can be used as a size type.

Public Static Attributes

constexpr auto value = size_t{Value}

Returns the value of the index.