ModErn Text Analysis
META Enumerates Textual Applications
Public Member Functions | Private Member Functions | Friends | List of all members
meta::util::numerical_identifier< Derived, T > Struct Template Reference

A CRTP template base that adds numeric functionality to the identifier type. More...

#include <identifiers.h>

Inheritance diagram for meta::util::numerical_identifier< Derived, T >:
meta::util::identifier< Derived, T > meta::util::numeric meta::util::comparable< identifier< Derived, T > >

Public Member Functions

Derived & operator++ ()
 Prefix-increment. More...
 
Derived operator++ (int)
 Postifx-increment. More...
 
Derived & operator-- ()
 Prefix-decrement. More...
 
Derived operator-- (int)
 Postfix-decrement. More...
 
Derived & operator+= (const T &step)
 
Derived & operator-= (const T &step)
 
- Public Member Functions inherited from meta::util::identifier< Derived, T >
 identifier (const T &t)
 identifiers must be explicitly constructed from their base type—they cannot be implicitly converted from them! More...
 
 identifier ()=default
 identifier has a default constructor.
 
 identifier (const identifier &)=default
 identifiers may be copy constructed.
 
 identifier (identifier &&)=default
 identifiers may be move constructed.
 
identifieroperator= (const identifier &)=default
 identifiers may be copy assigned.
 
identifieroperator= (identifier &&)=default
 identifiers may be move assigned.
 
identifieroperator= (const T &t)
 identifiers may be assigned into from their base type, provided they have already been constructed. More...
 
 operator const T & () const
 identifiers may be converted into their base type. More...
 
 operator T & ()
 identifiers may be converted into their base type. More...
 

Private Member Functions

Derived * derived ()
 Reinterprets the current numerical_identifier as is underlying Derived type.
 

Friends

Derived operator+ (Derived lhs, const Derived &rhs)
 
Derived operator- (Derived lhs, const Derived &rhs)
 

Additional Inherited Members

- Public Attributes inherited from meta::util::identifier< Derived, T >
id_
 The underlying id for the identifier.
 

Detailed Description

template<class Derived, class T>
struct meta::util::numerical_identifier< Derived, T >

A CRTP template base that adds numeric functionality to the identifier type.

numerical_identifiers support typical integer math functions on top of the things supported by identifiers.

Member Function Documentation

template<class Derived , class T >
Derived& meta::util::numerical_identifier< Derived, T >::operator++ ( )
inline

Prefix-increment.

Returns
the current identifier after being incremented
template<class Derived , class T >
Derived meta::util::numerical_identifier< Derived, T >::operator++ ( int  )
inline

Postifx-increment.

Returns
the old value of the identifier
template<class Derived , class T >
Derived& meta::util::numerical_identifier< Derived, T >::operator-- ( )
inline

Prefix-decrement.

Returns
the current identifier after being decremented
template<class Derived , class T >
Derived meta::util::numerical_identifier< Derived, T >::operator-- ( int  )
inline

Postfix-decrement.

Returns
the old value of the identifier
template<class Derived , class T >
Derived& meta::util::numerical_identifier< Derived, T >::operator+= ( const T &  step)
inline
Parameters
stepHow much to increase the current identifier by
Returns
the current identifier
template<class Derived , class T >
Derived& meta::util::numerical_identifier< Derived, T >::operator-= ( const T &  step)
inline
Parameters
stepHow much to decrease the current identifier by
Returns
the current identifier

Friends And Related Function Documentation

template<class Derived , class T >
Derived operator+ ( Derived  lhs,
const Derived &  rhs 
)
friend
Parameters
lhs
rhs
Returns
lhs + rhs, defined in terms of numerical_identifier::operator+=.
template<class Derived , class T >
Derived operator- ( Derived  lhs,
const Derived &  rhs 
)
friend
Parameters
lhs
rhs
Returns
lhs - rhs, defined in terms of numerical_identifier::operator-=.

The documentation for this struct was generated from the following file: