15template <
typename T,
typename Tag>
23 constexpr explicit StrongType(T value) : value_(std::move(value)) {}
28 [[nodiscard]]
constexpr T&
get() {
return value_; }
33 [[nodiscard]]
constexpr const T&
get()
const {
return value_; }
38 [[nodiscard]]
constexpr explicit operator T()
const {
return value_; }
Class template for creating strong type aliases.
Definition strong_type.hpp:16
constexpr T & get()
Get non-const reference to underlying value.
Definition strong_type.hpp:28
constexpr StrongType(T value)
Construct from any type.
Definition strong_type.hpp:23
constexpr const T & get() const
Get const reference to underlying value.
Definition strong_type.hpp:33