An indexable, hashable, named "strong type" template class. More...
#include <IndexingNamedType.hpp>
Public Types | |
| using | underlying_type = T |
| Underlying type alias. | |
Public Member Functions | |
| constexpr | IndexingNamedType () noexcept(std::is_nothrow_default_constructible< underlying_type >::value) |
| Default constructor. More... | |
| constexpr | IndexingNamedType (const underlying_type &value) noexcept(std::is_nothrow_copy_constructible< underlying_type >::value) |
| Copy initializing constructor. | |
| constexpr | IndexingNamedType (underlying_type &&value) noexcept(std::is_nothrow_move_constructible< underlying_type >::value) |
| Move initializing constructor. | |
| constexpr | operator underlying_type & () noexcept |
| Underlying type cast operator support. | |
| constexpr | operator const underlying_type & () const noexcept |
| Underlying type cast operator support. | |
| constexpr underlying_type & | get () noexcept |
| Accesses the underlying value. | |
| constexpr underlying_type const & | get () const noexcept |
| Accesses the underlying value. | |
Private Attributes | |
| underlying_type | value_ |
| Underlying value. | |
Friends | |
| void | swap (IndexingNamedType &a, IndexingNamedType &b) noexcept |
| Swap function. | |
| constexpr friend bool | operator== (const IndexingNamedType &lhs, const IndexingNamedType &rhs) |
| Equality operator. | |
| 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) |
| Greater-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) |
| Greater-than-or-equal-to operator. | |
| ::std::size_t | hash (const IndexingNamedType &v) noexcept |
| Hashes the value given. | |
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.
|
inlineexplicitconstexprnoexcept |
Default constructor.