CppCommon
1.0.4.1
C++ Common Library
|
Unsigned 128-bit integer type. More...
#include <uint128.h>
Public Member Functions | |
uint128_t () noexcept | |
uint128_t (int8_t value) noexcept | |
uint128_t (uint8_t value) noexcept | |
uint128_t (int16_t value) noexcept | |
uint128_t (uint16_t value) noexcept | |
uint128_t (int32_t value) noexcept | |
uint128_t (uint32_t value) noexcept | |
uint128_t (int64_t value) noexcept | |
uint128_t (uint64_t value) noexcept | |
template<typename T > | |
uint128_t (const T &value) noexcept | |
template<typename TUpper , typename TLower > | |
uint128_t (const TUpper &upper, const TLower &lower) noexcept | |
uint128_t (const uint128_t &value) noexcept=default | |
uint128_t (uint128_t &&value) noexcept=default | |
~uint128_t () noexcept=default | |
template<typename T > | |
uint128_t & | operator= (const T &value) noexcept |
uint128_t & | operator= (const uint128_t &value) noexcept=default |
uint128_t & | operator= (uint128_t &&value) noexcept=default |
uint128_t | operator+ () const noexcept |
uint128_t | operator- () const noexcept |
uint128_t & | operator++ () noexcept |
uint128_t | operator++ (int) noexcept |
uint128_t & | operator-- () noexcept |
uint128_t | operator-- (int) noexcept |
uint128_t & | operator+= (const uint128_t &value) noexcept |
uint128_t & | operator-= (const uint128_t &value) noexcept |
uint128_t & | operator*= (const uint128_t &value) noexcept |
uint128_t & | operator/= (const uint128_t &value) |
uint128_t & | operator%= (const uint128_t &value) |
template<typename T > | |
uint128_t & | operator+= (const T &value) noexcept |
template<typename T > | |
uint128_t & | operator-= (const T &value) noexcept |
template<typename T > | |
uint128_t & | operator*= (const T &value) noexcept |
template<typename T > | |
uint128_t & | operator/= (const T &value) |
template<typename T > | |
uint128_t & | operator%= (const T &value) |
uint128_t | operator~ () const noexcept |
uint128_t & | operator&= (const uint128_t &value) noexcept |
uint128_t & | operator|= (const uint128_t &value) noexcept |
uint128_t & | operator^= (const uint128_t &value) noexcept |
template<typename T > | |
uint128_t & | operator&= (const T &value) noexcept |
template<typename T > | |
uint128_t & | operator|= (const T &value) noexcept |
template<typename T > | |
uint128_t & | operator^= (const T &value) noexcept |
bool | operator! () const noexcept |
uint128_t & | operator<<= (const uint128_t &value) noexcept |
uint128_t & | operator>>= (const uint128_t &value) noexcept |
template<typename T > | |
uint128_t & | operator<<= (const T &value) noexcept |
template<typename T > | |
uint128_t & | operator>>= (const T &value) noexcept |
operator bool () const noexcept | |
operator uint8_t () const noexcept | |
operator uint16_t () const noexcept | |
operator uint32_t () const noexcept | |
operator uint64_t () const noexcept | |
uint64_t | upper () const noexcept |
Get the upper part of the 128-bit integer. More... | |
uint64_t | lower () const noexcept |
Get the lower part of the 128-bit integer. More... | |
size_t | bits () const noexcept |
Get the count of bits. More... | |
std::string | string (size_t base=10, size_t length=0) const |
Get string from the current 128-bit integer. More... | |
std::wstring | wstring (size_t base=10, size_t length=0) const |
Get wide string from the current 128-bit integer. More... | |
void | swap (uint128_t &value) noexcept |
Swap two instances. More... | |
Static Public Member Functions | |
static std::pair< uint128_t, uint128_t > | divmod (const uint128_t &x, const uint128_t &y) |
Calculate quotient and remainder when dividing X by Y. More... | |
Friends | |
template<typename T > | |
T & | operator+= (T &value1, const uint128_t &value2) noexcept |
template<typename T > | |
T & | operator-= (T &value1, const uint128_t &value2) noexcept |
template<typename T > | |
T & | operator*= (T &value1, const uint128_t &value2) noexcept |
template<typename T > | |
T & | operator/= (T &value1, const uint128_t &value2) |
template<typename T > | |
T & | operator%= (T &value1, const uint128_t &value2) |
template<typename T > | |
uint128_t | operator+ (const T &value1, const uint128_t &value2) noexcept |
template<typename T > | |
uint128_t | operator+ (const uint128_t &value1, const T &value2) noexcept |
uint128_t | operator+ (const uint128_t &value1, const uint128_t &value2) noexcept |
template<typename T > | |
uint128_t | operator- (const T &value1, const uint128_t &value2) noexcept |
template<typename T > | |
uint128_t | operator- (const uint128_t &value1, const T &value2) noexcept |
uint128_t | operator- (const uint128_t &value1, const uint128_t &value2) noexcept |
template<typename T > | |
uint128_t | operator* (const T &value1, const uint128_t &value2) noexcept |
template<typename T > | |
uint128_t | operator* (const uint128_t &value1, const T &value2) noexcept |
uint128_t | operator* (const uint128_t &value1, const uint128_t &value2) noexcept |
template<typename T > | |
uint128_t | operator/ (const T &value1, const uint128_t &value2) |
template<typename T > | |
uint128_t | operator/ (const uint128_t &value1, const T &value2) |
uint128_t | operator/ (const uint128_t &value1, const uint128_t &value2) |
template<typename T > | |
uint128_t | operator% (const T &value1, const uint128_t &value2) |
template<typename T > | |
uint128_t | operator% (const uint128_t &value1, const T &value2) |
uint128_t | operator% (const uint128_t &value1, const uint128_t &value2) |
template<typename T > | |
T & | operator&= (T &value1, const uint128_t &value2) noexcept |
template<typename T > | |
T & | operator|= (T &value1, const uint128_t &value2) noexcept |
template<typename T > | |
T & | operator^= (T &value1, const uint128_t &value2) noexcept |
template<typename T > | |
uint128_t | operator& (const T &value1, const uint128_t &value2) noexcept |
template<typename T > | |
uint128_t | operator& (const uint128_t &value1, const T &value2) noexcept |
uint128_t | operator& (const uint128_t &value1, const uint128_t &value2) noexcept |
template<typename T > | |
uint128_t | operator| (const T &value1, const uint128_t &value2) noexcept |
template<typename T > | |
uint128_t | operator| (const uint128_t &value1, const T &value2) noexcept |
uint128_t | operator| (const uint128_t &value1, const uint128_t &value2) noexcept |
template<typename T > | |
uint128_t | operator^ (const T &value1, const uint128_t &value2) noexcept |
template<typename T > | |
uint128_t | operator^ (const uint128_t &value1, const T &value2) noexcept |
uint128_t | operator^ (const uint128_t &value1, const uint128_t &value2) noexcept |
template<typename T > | |
bool | operator== (const T &value1, const uint128_t &value2) noexcept |
template<typename T > | |
bool | operator== (const uint128_t &value1, const T &value2) noexcept |
bool | operator== (const uint128_t &value1, const uint128_t &value2) noexcept |
template<typename T > | |
bool | operator!= (const T &value1, const uint128_t &value2) noexcept |
template<typename T > | |
bool | operator!= (const uint128_t &value1, const T &value2) noexcept |
bool | operator!= (const uint128_t &value1, const uint128_t &value2) noexcept |
template<typename T > | |
bool | operator< (const T &value1, const uint128_t &value2) noexcept |
template<typename T > | |
bool | operator< (const uint128_t &value1, const T &value2) noexcept |
bool | operator< (const uint128_t &value1, const uint128_t &value2) noexcept |
template<typename T > | |
bool | operator> (const T &value1, const uint128_t &value2) noexcept |
template<typename T > | |
bool | operator> (const uint128_t &value1, const T &value2) noexcept |
bool | operator> (const uint128_t &value1, const uint128_t &value2) noexcept |
template<typename T > | |
bool | operator<= (const T &value1, const uint128_t &value2) noexcept |
template<typename T > | |
bool | operator<= (const uint128_t &value1, const T &value2) noexcept |
bool | operator<= (const uint128_t &value1, const uint128_t &value2) noexcept |
template<typename T > | |
bool | operator>= (const T &value1, const uint128_t &value2) noexcept |
template<typename T > | |
bool | operator>= (const uint128_t &value1, const T &value2) noexcept |
bool | operator>= (const uint128_t &value1, const uint128_t &value2) noexcept |
template<typename T > | |
bool | operator&& (const T &value1, const uint128_t &value2) noexcept |
template<typename T > | |
bool | operator&& (const uint128_t &value1, const T &value2) noexcept |
bool | operator&& (const uint128_t &value1, const uint128_t &value2) noexcept |
template<typename T > | |
bool | operator|| (const T &value1, const uint128_t &value2) noexcept |
template<typename T > | |
bool | operator|| (const uint128_t &value1, const T &value2) noexcept |
bool | operator|| (const uint128_t &value1, const uint128_t &value2) noexcept |
template<typename T > | |
T & | operator<<= (T &value1, const uint128_t &value2) noexcept |
template<typename T > | |
T & | operator>>= (T &value1, const uint128_t &value2) noexcept |
template<typename T > | |
uint128_t | operator<< (const uint128_t &value1, const T &value2) noexcept |
uint128_t | operator<< (bool value1, const uint128_t &value2) noexcept |
uint128_t | operator<< (int8_t value1, const uint128_t &value2) noexcept |
uint128_t | operator<< (int16_t value1, const uint128_t &value2) noexcept |
uint128_t | operator<< (int32_t value1, const uint128_t &value2) noexcept |
uint128_t | operator<< (int64_t value1, const uint128_t &value2) noexcept |
uint128_t | operator<< (uint8_t value1, const uint128_t &value2) noexcept |
uint128_t | operator<< (uint16_t value1, const uint128_t &value2) noexcept |
uint128_t | operator<< (uint32_t value1, const uint128_t &value2) noexcept |
uint128_t | operator<< (uint64_t value1, const uint128_t &value2) noexcept |
uint128_t | operator<< (const uint128_t &value1, const uint128_t &value2) noexcept |
template<typename T > | |
uint128_t | operator>> (const uint128_t &value1, const T &value2) noexcept |
uint128_t | operator>> (bool value1, const uint128_t &value2) noexcept |
uint128_t | operator>> (int8_t value1, const uint128_t &value2) noexcept |
uint128_t | operator>> (int16_t value1, const uint128_t &value2) noexcept |
uint128_t | operator>> (int32_t value1, const uint128_t &value2) noexcept |
uint128_t | operator>> (int64_t value1, const uint128_t &value2) noexcept |
uint128_t | operator>> (uint8_t value1, const uint128_t &value2) noexcept |
uint128_t | operator>> (uint16_t value1, const uint128_t &value2) noexcept |
uint128_t | operator>> (uint32_t value1, const uint128_t &value2) noexcept |
uint128_t | operator>> (uint64_t value1, const uint128_t &value2) noexcept |
uint128_t | operator>> (const uint128_t &value1, const uint128_t &value2) noexcept |
std::istream & | operator>> (std::istream &is, uint128_t &value) |
Input instance from the given input stream. More... | |
std::wistream & | operator>> (std::wistream &is, uint128_t &value) |
Input instance from the given wide input stream. More... | |
std::ostream & | operator<< (std::ostream &os, const uint128_t &value) |
Output instance into the given output stream. More... | |
std::wostream & | operator<< (std::wostream &os, const uint128_t &value) |
Output instance into the given wide output stream. More... | |
void | swap (uint128_t &value1, uint128_t &value2) noexcept |
Unsigned 128-bit integer type.
Represents unsigned 128-bit integer type and provides basic arithmetic operations.
|
inlinenoexcept |
Definition at line 11 of file uint128.inl.
|
inlinenoexcept |
Definition at line 16 of file uint128.inl.
|
inlinenoexcept |
Definition at line 21 of file uint128.inl.
|
inlinenoexcept |
Definition at line 26 of file uint128.inl.
|
inlinenoexcept |
Definition at line 31 of file uint128.inl.
|
inlinenoexcept |
Definition at line 36 of file uint128.inl.
|
inlinenoexcept |
Definition at line 41 of file uint128.inl.
|
inlinenoexcept |
Definition at line 46 of file uint128.inl.
|
inlinenoexcept |
Definition at line 51 of file uint128.inl.
|
inlineexplicitnoexcept |
Definition at line 57 of file uint128.inl.
|
inlinenoexcept |
Definition at line 64 of file uint128.inl.
|
defaultnoexcept |
|
defaultnoexcept |
|
defaultnoexcept |
|
noexcept |
Get the count of bits.
Definition at line 94 of file uint128.cpp.
|
static |
Calculate quotient and remainder when dividing X by Y.
x | - X value |
y | - Y value |
Definition at line 171 of file uint128.cpp.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
Definition at line 71 of file uint128.inl.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
std::string CppCommon::uint128_t::string | ( | size_t | base = 10 , |
size_t | length = 0 |
||
) | const |
Get string from the current 128-bit integer.
base | - Conversion base in range [2, 16] (default is 10) |
length | - Minimal string length (default is 0) |
Definition at line 121 of file uint128.cpp.
|
inlinenoexcept |
Swap two instances.
Definition at line 177 of file uint128.inl.
|
inlinenoexcept |
std::wstring CppCommon::uint128_t::wstring | ( | size_t | base = 10 , |
size_t | length = 0 |
||
) | const |
Get wide string from the current 128-bit integer.
base | - Conversion base in range [2, 16] (default is 10) |
length | - Minimal string length (default is 0) |
Definition at line 146 of file uint128.cpp.
Definition at line 120 of file uint128.inl.
Definition at line 95 of file uint128.inl.
|
friend |
Definition at line 100 of file uint128.inl.
|
friend |
|
friend |
Definition at line 145 of file uint128.inl.
|
friend |
Definition at line 13 of file uint128.cpp.
|
friend |
Definition at line 80 of file uint128.inl.
|
friend |
Definition at line 85 of file uint128.inl.
|
friend |
Definition at line 90 of file uint128.inl.
|
friend |
|
friend |
|
friend |
Definition at line 125 of file uint128.inl.
Definition at line 58 of file uint128.cpp.
|
friend |
Output instance into the given output stream.
Definition at line 155 of file uint128.inl.
|
friend |
Output instance into the given wide output stream.
Definition at line 166 of file uint128.inl.
|
friend |
|
friend |
|
friend |
Definition at line 135 of file uint128.inl.
|
friend |
|
friend |
Definition at line 115 of file uint128.inl.
|
friend |
|
friend |
Definition at line 130 of file uint128.inl.
|
friend |
|
friend |
Definition at line 140 of file uint128.inl.
Definition at line 76 of file uint128.cpp.
|
friend |
|
friend |
|
friend |
Definition at line 110 of file uint128.inl.
|
friend |
Definition at line 105 of file uint128.inl.
|
friend |
|
friend |
|
friend |
Definition at line 150 of file uint128.inl.
Definition at line 184 of file uint128.inl.