Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <strong_int.h>
Classes | |
struct | Hasher |
Public Types | |
typedef _ValueType | ValueType |
typedef StrongInt< StrongIntName, ValueType > | ThisType |
Public Member Functions | |
constexpr | StrongInt () |
Default c'tor initializing value_ to 0. | |
constexpr | StrongInt (ValueType value) |
C'tor explicitly initializing from a ValueType. | |
constexpr ValueType | value () const |
template<typename ValType > | |
constexpr ValType | value () const |
template<typename T , typename = std::enable_if_t<std::conjunction_v< std::bool_constant<std::numeric_limits<T>::is_integer>, std::is_convertible<ValueType, T>>>> | |
constexpr | operator T () 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 |
STRONG_INT_TYPE_ASSIGNMENT_OP (+=) | |
STRONG_INT_TYPE_ASSIGNMENT_OP (-=) | |
STRONG_INT_TYPE_ASSIGNMENT_OP * | STRONG_INT_TYPE_ASSIGNMENT_OP (/=);STRONG_INT_TYPE_ASSIGNMENT_OP(<<= |
STRONG_INT_TYPE_ASSIGNMENT_OP (> >=) | |
STRONG_INT_TYPE_ASSIGNMENT_OP (%=) | |
ThisType & | operator= (ValueType arg_value) |
Static Public Member Functions | |
static constexpr absl::string_view | TypeName () |
Holds a integral value (of type ValueType) and behaves as a ValueType by exposing assignment, unary, comparison, and arithmetic operators.
The template parameter StrongIntName defines the name for the int type and must be unique within a binary (the convenient DEFINE_STRONG_INT macro at the end of the file generates a unique StrongIntName). The parameter ValueType defines the integer type value (see supported list above).
This class is NOT thread-safe.
Definition at line 186 of file strong_int.h.
StrongInt<StrongIntName, ValueType> util_intops::StrongInt< StrongIntName, _ValueType >::ThisType |
Definition at line 189 of file strong_int.h.
_ValueType util_intops::StrongInt< StrongIntName, _ValueType >::ValueType |
Definition at line 188 of file strong_int.h.
|
inlineconstexpr |
Default c'tor initializing value_ to 0.
Definition at line 205 of file strong_int.h.
|
inlineexplicitconstexpr |
C'tor explicitly initializing from a ValueType.
Definition at line 207 of file strong_int.h.
|
inlineexplicitconstexpr |
Explicitly cast the raw value only if the underlying value is convertible to T.
Definition at line 230 of file strong_int.h.
|
inlineconstexpr |
Definition at line 254 of file strong_int.h.
|
inlineconstexpr |
Definition at line 255 of file strong_int.h.
|
inline |
– UNARY OPERATORS -----------------------------------------------------—
Definition at line 235 of file strong_int.h.
|
inline |
Definition at line 239 of file strong_int.h.
|
inlineconstexpr |
Definition at line 256 of file strong_int.h.
|
inline |
Definition at line 244 of file strong_int.h.
|
inline |
Definition at line 248 of file strong_int.h.
|
inline |
Definition at line 280 of file strong_int.h.
|
inlineconstexpr |
Definition at line 257 of file strong_int.h.
util_intops::StrongInt< StrongIntName, _ValueType >::STRONG_INT_TYPE_ASSIGNMENT_OP | ( | % | ) |
util_intops::StrongInt< StrongIntName, _ValueType >::STRONG_INT_TYPE_ASSIGNMENT_OP | ( | + | ) |
util_intops::StrongInt< StrongIntName, _ValueType >::STRONG_INT_TYPE_ASSIGNMENT_OP | ( | - | ) |
STRONG_INT_TYPE_ASSIGNMENT_OP * util_intops::StrongInt< StrongIntName, _ValueType >::STRONG_INT_TYPE_ASSIGNMENT_OP | ( | / | ) |
util_intops::StrongInt< StrongIntName, _ValueType >::STRONG_INT_TYPE_ASSIGNMENT_OP | ( | >= | ) |
|
inlinestaticconstexpr |
Definition at line 191 of file strong_int.h.
|
inlineconstexpr |
StrongInt 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 strong_int.h.
|
inlineconstexpr |
Definition at line 220 of file strong_int.h.