Type helper for creating strong index types that are type-level distinct from their fundamental types. More...
#include <StrongIndex.h>
Public Types | |
using | value_type = T |
using | Hash = boost::hash< StrongIndex< Tag, T >> |
Public Member Functions | |
constexpr | StrongIndex ()=default |
Default constructor does not value initialize. | |
constexpr | StrongIndex (T v) |
Explicit value initialization. | |
constexpr | StrongIndex (const StrongIndex &other)=default |
constexpr | StrongIndex (StrongIndex &&other) noexcept=default |
constexpr StrongIndex & | operator= (const StrongIndex &other)=default |
constexpr StrongIndex & | operator= (StrongIndex &&other) noexcept=default |
constexpr StrongIndex & | operator= (const T &v) |
Assignment from fundamental base type. | |
constexpr | operator T & () noexcept |
constexpr | operator const T & () const noexcept |
constexpr auto | tie () const |
Public Member Functions inherited from Scine::Molassembler::Temple::Crtp::LexicographicComparable< StrongIndex< Tag, T > > | |
constexpr bool | operator== (const LexicographicComparable &other) const |
constexpr bool | operator!= (const LexicographicComparable &other) const |
constexpr bool | operator< (const LexicographicComparable &other) const |
constexpr bool | operator<= (const LexicographicComparable &other) const |
constexpr bool | operator> (const LexicographicComparable &other) const |
constexpr bool | operator>= (const LexicographicComparable &other) const |
Private Attributes | |
T | v_ |
Additional Inherited Members | |
Static Public Member Functions inherited from Scine::Molassembler::Temple::Crtp::LexicographicComparable< StrongIndex< Tag, T > > | |
static constexpr const StrongIndex< Tag, T > & | derived (const LexicographicComparable &base) |
Type helper for creating strong index types that are type-level distinct from their fundamental types.
Tag | Distinct tag type for each distinct 'type' of tag to avoid interconvertibility |
T | Fundamental type of the index |
Example: Defining a new strong index type