Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <strong_integers.h>
Public Types | |
typedef int | ValueType |
typedef StrongIndex< StrongIndexName > | ThisType |
Public Member Functions | |
struct | ABSL_DEPRECATED ("Use absl::Hash instead") Hasher |
constexpr | StrongIndex () |
constexpr | StrongIndex (int value) |
StrongIndex & | operator= (int arg_value) |
constexpr int | value () const |
template<typename ValType > | |
constexpr ValType | value () const |
constexpr ThisType | operator+ () const |
constexpr ThisType | operator- () const |
STRONG_ASSIGNMENT_OP (StrongIndex, int,+=) | |
STRONG_ASSIGNMENT_OP (StrongIndex, int, -=) | |
Static Public Member Functions | |
static constexpr absl::string_view | TypeName () |
Public Attributes | |
INCREMENT_AND_DECREMENT_OPERATORS | |
Holds an int value and behaves as an int by exposing assignment, unary, comparison, and arithmetic operators.
The template parameter StrongIndexName defines the name for the int type and must be unique within a binary (the convenient DEFINE_STRONG_INDEX_TYPE macro at the start of the file generates a unique StrongIndexName).
This class is NOT thread-safe.
Definition at line 137 of file strong_integers.h.
StrongIndex<StrongIndexName> operations_research::StrongIndex< StrongIndexName >::ThisType |
Definition at line 140 of file strong_integers.h.
int operations_research::StrongIndex< StrongIndexName >::ValueType |
Definition at line 139 of file strong_integers.h.
|
inlineconstexpr |
Definition at line 152 of file strong_integers.h.
|
inlineexplicitconstexpr |
Definition at line 154 of file strong_integers.h.
|
inline |
Definition at line 142 of file strong_integers.h.
|
inlineconstexpr |
Definition at line 171 of file strong_integers.h.
|
inlineconstexpr |
Definition at line 172 of file strong_integers.h.
|
inline |
Definition at line 156 of file strong_integers.h.
operations_research::StrongIndex< StrongIndexName >::STRONG_ASSIGNMENT_OP | ( | StrongIndex< StrongIndexName > | , |
int | , | ||
- | ) |
operations_research::StrongIndex< StrongIndexName >::STRONG_ASSIGNMENT_OP | ( | StrongIndex< StrongIndexName > | , |
int | , | ||
+ | ) |
|
inlinestaticconstexpr |
Definition at line 142 of file strong_integers.h.
|
inlineconstexpr |
The class provides a value() accessor returning the stored int value_ as well as a templatized accessor that is just a syntactic sugar for static_cast<T>(var.value());
Definition at line 164 of file strong_integers.h.
|
inlineconstexpr |
Definition at line 167 of file strong_integers.h.
operations_research::StrongIndex< StrongIndexName >::INCREMENT_AND_DECREMENT_OPERATORS |
Definition at line 174 of file strong_integers.h.