![]() |
Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
|
Holds a integral value (of type ValueType) and behaves as a ValueType by exposing assignment, unary, comparison, and arithmetic operators.
The template parameter IntTypeName defines the name for the int type and must be unique within a binary (the convenient DEFINE_INT_TYPE macro at the end of the file generates a unique IntTypeName). The parameter ValueType defines the integer type value (see supported list above).
This class is NOT thread-safe.
Definition at line 182 of file int_type.h.
#include <int_type.h>
Classes | |
| struct | Hasher |
Public Types | |
| typedef _ValueType | ValueType |
| typedef IntType< IntTypeName, ValueType > | ThisType |
Public Member Functions | |
| constexpr | IntType () |
| Default constructor initializing value_ to 0. | |
| constexpr | IntType (ValueType value) |
| C'tor explicitly initializing from a ValueType. | |
| constexpr ValueType | value () const |
| template<typename ValType> | |
| constexpr ValType | value () const |
| ThisType & | operator++ () |
| – UNARY OPERATORS -----------------------------------------------------— | |
| const ThisType | operator++ (int v) |
| ThisType & | operator-- () |
| const ThisType | operator-- (int v) |
| constexpr bool | operator! () const |
| constexpr const ThisType | operator+ () const |
| constexpr const ThisType | operator- () const |
| constexpr const ThisType | operator~ () const |
| INT_TYPE_ASSIGNMENT_OP (+=) | |
| INT_TYPE_ASSIGNMENT_OP (-=) | |
| INT_TYPE_ASSIGNMENT_OP * | INT_TYPE_ASSIGNMENT_OP (/=);INT_TYPE_ASSIGNMENT_OP(<<= |
| INT_TYPE_ASSIGNMENT_OP (> >=) | |
| INT_TYPE_ASSIGNMENT_OP (%=) | |
| ThisType & | operator= (ValueType arg_value) |
Static Public Member Functions | |
| static constexpr absl::string_view | TypeName () |
Friends | |
| template<typename H> | |
| H | AbslHashValue (H h, const IntType &i) |
| typedef IntType<IntTypeName, ValueType> gtl::IntType< IntTypeName, _ValueType >::ThisType |
Definition at line 185 of file int_type.h.
| typedef _ValueType gtl::IntType< IntTypeName, _ValueType >::ValueType |
Definition at line 184 of file int_type.h.
|
inlineconstexpr |
Default constructor initializing value_ to 0.
Definition at line 205 of file int_type.h.
|
inlineexplicitconstexpr |
C'tor explicitly initializing from a ValueType.
Definition at line 207 of file int_type.h.
| gtl::IntType< IntTypeName, _ValueType >::INT_TYPE_ASSIGNMENT_OP | ( | % | ) |
| gtl::IntType< IntTypeName, _ValueType >::INT_TYPE_ASSIGNMENT_OP | ( | + | ) |
| gtl::IntType< IntTypeName, _ValueType >::INT_TYPE_ASSIGNMENT_OP | ( | - | ) |
| INT_TYPE_ASSIGNMENT_OP * gtl::IntType< IntTypeName, _ValueType >::INT_TYPE_ASSIGNMENT_OP | ( | / | ) |
| gtl::IntType< IntTypeName, _ValueType >::INT_TYPE_ASSIGNMENT_OP | ( | >= | ) |
|
inlineconstexpr |
Definition at line 244 of file int_type.h.
|
inlineconstexpr |
Definition at line 245 of file int_type.h.
|
inline |
– UNARY OPERATORS -----------------------------------------------------—
Definition at line 225 of file int_type.h.
|
inline |
Definition at line 229 of file int_type.h.
|
inlineconstexpr |
Definition at line 246 of file int_type.h.
|
inline |
Definition at line 234 of file int_type.h.
|
inline |
Definition at line 238 of file int_type.h.
|
inline |
Definition at line 270 of file int_type.h.
|
inlineconstexpr |
Definition at line 247 of file int_type.h.
|
inlinestaticconstexpr |
Definition at line 187 of file int_type.h.
|
inlineconstexpr |
IntType uses the default copy constructor, destructor and assign operator. The defaults are sufficient and omitting them allows the compiler to add the move constructor/assignment. – ACCESSORS -----------------------------------------------------------— The class provides a value() accessor returning the stored ValueType value_ as well as a templatized accessor that is just a syntactic sugar for static_cast<T>(var.value());
Definition at line 217 of file int_type.h.
|
inlineconstexpr |
Definition at line 220 of file int_type.h.
|
friend |
Definition at line 199 of file int_type.h.