6 #ifndef UTILS_STRONG_TYPE_H 7 #define UTILS_STRONG_TYPE_H 27 template <
typename ValueType,
typename PhantomType>
41 template <
typename RT>
42 inline typename std::enable_if_t<std::is_arithmetic_v<RT>, RT>
As()
const 44 return static_cast<RT
>(
value_);
55 friend std::ostream &operator<< (std::ostream &out, const StrongType<ValueType, PhantomType> &id)
const ValueType & operator*() const
Get underlying value using the * operator.
Definition: StrongType.h:53
Template class implementation of a Named Strong Type.
Definition: StrongType.h:28
std::enable_if_t< std::is_arithmetic_v< RT >, RT > As() const
Cast to a specified type. Only work for arithmetic types.
Definition: StrongType.h:42
ValueType value_
The actual underlying value.
Definition: StrongType.h:63
General namespace for utilities.
Definition: BulletConversions.h:9