Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::StrongInt64< StrongIntegerName > Class Template Reference

#include <strong_integers.h>

Public Types

typedef int64_t ValueType
 
typedef StrongInt64< StrongIntegerName > ThisType
 

Public Member Functions

struct ABSL_DEPRECATED ("Use absl::Hash instead") Hasher
 
constexpr StrongInt64 ()
 
constexpr StrongInt64 (int64_t value)
 NOLINTBEGIN(google-explicit-constructor)
 
StrongInt64operator= (int64_t arg_value)
 NOLINTEND(google-explicit-constructor)
 
constexpr int64_t value () const
 
template<typename ValType >
constexpr ValType value () const
 
constexpr ThisType operator+ () const
 
constexpr ThisType operator- () const
 
constexpr ThisType operator~ () const
 
 STRONG_ASSIGNMENT_OP (StrongInt64, int64_t,+=)
 
 STRONG_ASSIGNMENT_OP (StrongInt64, int64_t, -=)
 
 STRONG_ASSIGNMENT_OP (StrongInt64, int64_t, *=)
 
 STRONG_ASSIGNMENT_OP (StrongInt64, int64_t,/=)
 
 STRONG_ASSIGNMENT_OP (StrongInt64, int64_t,<<=)
 
 STRONG_ASSIGNMENT_OP (StrongInt64, int64_t, > >=)
 
 STRONG_ASSIGNMENT_OP (StrongInt64, int64_t, %=)
 

Static Public Member Functions

static constexpr absl::string_view TypeName ()
 

Public Attributes

 INCREMENT_AND_DECREMENT_OPERATORS
 

Detailed Description

template<typename StrongIntegerName>
class operations_research::StrongInt64< StrongIntegerName >

Holds an int64_t value and behaves as an int64_t by exposing assignment, unary, comparison, and arithmetic operators.

The template parameter StrongIntegerName defines the name for the int type and must be unique within a binary (the convenient DEFINE_STRONG_INTEGER_TYPE macro at the start of the file generates a unique StrongIntegerName).

This class is NOT thread-safe.

Definition at line 192 of file strong_integers.h.

Member Typedef Documentation

◆ ThisType

template<typename StrongIntegerName >
StrongInt64<StrongIntegerName> operations_research::StrongInt64< StrongIntegerName >::ThisType

Definition at line 195 of file strong_integers.h.

◆ ValueType

template<typename StrongIntegerName >
int64_t operations_research::StrongInt64< StrongIntegerName >::ValueType

Definition at line 194 of file strong_integers.h.

Constructor & Destructor Documentation

◆ StrongInt64() [1/2]

template<typename StrongIntegerName >
operations_research::StrongInt64< StrongIntegerName >::StrongInt64 ( )
inlineconstexpr

Definition at line 207 of file strong_integers.h.

◆ StrongInt64() [2/2]

template<typename StrongIntegerName >
operations_research::StrongInt64< StrongIntegerName >::StrongInt64 ( int64_t value)
inlineconstexpr

NOLINTBEGIN(google-explicit-constructor)

Definition at line 210 of file strong_integers.h.

Member Function Documentation

◆ ABSL_DEPRECATED()

template<typename StrongIntegerName >
struct operations_research::StrongInt64< StrongIntegerName >::ABSL_DEPRECATED ( "Use absl::Hash instead" )
inline

Definition at line 197 of file strong_integers.h.

◆ operator+()

template<typename StrongIntegerName >
ThisType operations_research::StrongInt64< StrongIntegerName >::operator+ ( ) const
inlineconstexpr

Definition at line 227 of file strong_integers.h.

◆ operator-()

template<typename StrongIntegerName >
ThisType operations_research::StrongInt64< StrongIntegerName >::operator- ( ) const
inlineconstexpr

Definition at line 228 of file strong_integers.h.

◆ operator=()

template<typename StrongIntegerName >
StrongInt64 & operations_research::StrongInt64< StrongIntegerName >::operator= ( int64_t arg_value)
inline

NOLINTEND(google-explicit-constructor)

Definition at line 213 of file strong_integers.h.

◆ operator~()

template<typename StrongIntegerName >
ThisType operations_research::StrongInt64< StrongIntegerName >::operator~ ( ) const
inlineconstexpr

Definition at line 229 of file strong_integers.h.

◆ STRONG_ASSIGNMENT_OP() [1/7]

template<typename StrongIntegerName >
operations_research::StrongInt64< StrongIntegerName >::STRONG_ASSIGNMENT_OP ( StrongInt64< StrongIntegerName > ,
int64_t ,
%  )

◆ STRONG_ASSIGNMENT_OP() [2/7]

template<typename StrongIntegerName >
operations_research::StrongInt64< StrongIntegerName >::STRONG_ASSIGNMENT_OP ( StrongInt64< StrongIntegerName > ,
int64_t ,
*  )

◆ STRONG_ASSIGNMENT_OP() [3/7]

template<typename StrongIntegerName >
operations_research::StrongInt64< StrongIntegerName >::STRONG_ASSIGNMENT_OP ( StrongInt64< StrongIntegerName > ,
int64_t ,
-  )

◆ STRONG_ASSIGNMENT_OP() [4/7]

template<typename StrongIntegerName >
operations_research::StrongInt64< StrongIntegerName >::STRONG_ASSIGNMENT_OP ( StrongInt64< StrongIntegerName > ,
int64_t ,
>=  )

◆ STRONG_ASSIGNMENT_OP() [5/7]

template<typename StrongIntegerName >
operations_research::StrongInt64< StrongIntegerName >::STRONG_ASSIGNMENT_OP ( StrongInt64< StrongIntegerName > ,
int64_t ,
+  )

◆ STRONG_ASSIGNMENT_OP() [6/7]

template<typename StrongIntegerName >
operations_research::StrongInt64< StrongIntegerName >::STRONG_ASSIGNMENT_OP ( StrongInt64< StrongIntegerName > ,
int64_t ,
/  )

◆ STRONG_ASSIGNMENT_OP() [7/7]

template<typename StrongIntegerName >
operations_research::StrongInt64< StrongIntegerName >::STRONG_ASSIGNMENT_OP ( StrongInt64< StrongIntegerName > ,
int64_t ,
<<  )

◆ TypeName()

template<typename StrongIntegerName >
static constexpr absl::string_view operations_research::StrongInt64< StrongIntegerName >::TypeName ( )
inlinestaticconstexpr

Definition at line 197 of file strong_integers.h.

◆ value() [1/2]

template<typename StrongIntegerName >
int64_t operations_research::StrongInt64< StrongIntegerName >::value ( ) const
inlineconstexpr

Definition at line 218 of file strong_integers.h.

◆ value() [2/2]

template<typename StrongIntegerName >
template<typename ValType >
ValType operations_research::StrongInt64< StrongIntegerName >::value ( ) const
inlineconstexpr

Definition at line 221 of file strong_integers.h.

Member Data Documentation

◆ INCREMENT_AND_DECREMENT_OPERATORS

template<typename StrongIntegerName >
operations_research::StrongInt64< StrongIntegerName >::INCREMENT_AND_DECREMENT_OPERATORS

Definition at line 225 of file strong_integers.h.


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