An indexable, hashable, named "strong type" template class. More...
#include <playrho/detail/IndexingNamedType.hpp>
Public Types | |
using | underlying_type = T |
Underlying type alias. | |
Public Member Functions | |
constexpr | IndexingNamedType () noexcept(std::is_nothrow_default_constructible_v< underlying_type >) |
Default constructor. More... | |
constexpr | IndexingNamedType (const underlying_type &value) noexcept(std::is_nothrow_copy_constructible_v< underlying_type >) |
Copy initializing constructor. | |
constexpr | IndexingNamedType (underlying_type &&value) noexcept(std::is_nothrow_move_constructible_v< underlying_type >) |
Move initializing constructor. | |
constexpr underlying_type const & | get () const noexcept |
Accesses the underlying value. | |
constexpr underlying_type & | get () noexcept |
Accesses the underlying value. | |
constexpr | operator const underlying_type & () const noexcept |
Underlying type cast operator support. | |
constexpr | operator underlying_type & () noexcept |
Underlying type cast operator support. | |
Friends | |
::std::size_t | hash (const IndexingNamedType &v) noexcept |
Hashes the value given. | |
constexpr friend bool | operator!= (const IndexingNamedType &lhs, const IndexingNamedType &rhs) |
Inequality operator. | |
constexpr friend bool | operator< (const IndexingNamedType &lhs, const IndexingNamedType &rhs) |
Less-than operator. | |
constexpr friend bool | operator<= (const IndexingNamedType &lhs, const IndexingNamedType &rhs) |
Less-than-or-equal-to operator. | |
constexpr friend bool | operator== (const IndexingNamedType &lhs, const IndexingNamedType &rhs) |
Equality operator. | |
constexpr friend bool | operator> (const IndexingNamedType &lhs, const IndexingNamedType &rhs) |
Greater-than operator. | |
constexpr friend bool | operator>= (const IndexingNamedType &lhs, const IndexingNamedType &rhs) |
Greater-than-or-equal-to operator. | |
void | swap (IndexingNamedType &a, IndexingNamedType &b) noexcept |
Swap function. | |
Related Functions | |
(Note that these are not member functions.) | |
template<typename T , typename Tag > | |
constexpr const T & | UnderlyingValue (const IndexingNamedType< T, Tag > &o) noexcept |
Gets the underlying value. | |
template<typename T , typename Tag > | |
constexpr T & | UnderlyingValue (IndexingNamedType< T, Tag > &o) noexcept |
Gets the underlying value. | |
An indexable, hashable, named "strong type" template class.
A template class for wrapping types into more special-purposed types. Wrapping types this way is often referred to as more "strongly typing" the underlying type.
|
inlineconstexprnoexcept |
Default constructor.