CppCommon  1.0.4.1
C++ Common Library
Public Member Functions | Static Public Member Functions | Friends | List of all members
CppCommon::uint256_t Class Reference

Unsigned 256-bit integer type. More...

#include <uint256.h>

Public Member Functions

 uint256_t () noexcept
 
 uint256_t (int8_t value) noexcept
 
 uint256_t (uint8_t value) noexcept
 
 uint256_t (int16_t value) noexcept
 
 uint256_t (uint16_t value) noexcept
 
 uint256_t (int32_t value) noexcept
 
 uint256_t (uint32_t value) noexcept
 
 uint256_t (int64_t value) noexcept
 
 uint256_t (uint64_t value) noexcept
 
 uint256_t (uint128_t value) noexcept
 
template<typename T >
 uint256_t (const T &value) noexcept
 
template<typename TUpper , typename TLower >
 uint256_t (const TUpper &upper, const TLower &lower) noexcept
 
template<typename TUpperUpper , typename TUpperLower , typename TLowerUpper , typename TLowerLower >
 uint256_t (const TUpperUpper &upper_upper, const TUpperLower &upper_lower, const TLowerUpper &lower_upper, const TLowerLower &lower_lower) noexcept
 
 uint256_t (const uint256_t &) noexcept=default
 
 uint256_t (uint256_t &&) noexcept=default
 
 ~uint256_t () noexcept=default
 
template<typename T >
uint256_toperator= (const T &value) noexcept
 
uint256_toperator= (const uint256_t &) noexcept=default
 
uint256_toperator= (uint256_t &&) noexcept=default
 
uint256_t operator+ () const noexcept
 
uint256_t operator- () const noexcept
 
uint256_toperator++ () noexcept
 
uint256_t operator++ (int) noexcept
 
uint256_toperator-- () noexcept
 
uint256_t operator-- (int) noexcept
 
uint256_toperator+= (const uint256_t &value) noexcept
 
uint256_toperator-= (const uint256_t &value) noexcept
 
uint256_toperator*= (const uint256_t &value) noexcept
 
uint256_toperator/= (const uint256_t &value)
 
uint256_toperator%= (const uint256_t &value)
 
template<typename T >
uint256_toperator+= (const T &value) noexcept
 
template<typename T >
uint256_toperator-= (const T &value) noexcept
 
template<typename T >
uint256_toperator*= (const T &value) noexcept
 
template<typename T >
uint256_toperator/= (const T &value)
 
template<typename T >
uint256_toperator%= (const T &value)
 
uint256_t operator~ () const noexcept
 
uint256_toperator&= (const uint256_t &value) noexcept
 
uint256_toperator|= (const uint256_t &value) noexcept
 
uint256_toperator^= (const uint256_t &value) noexcept
 
template<typename T >
uint256_toperator&= (const T &value) noexcept
 
template<typename T >
uint256_toperator|= (const T &value) noexcept
 
template<typename T >
uint256_toperator^= (const T &value) noexcept
 
bool operator! () const noexcept
 
uint256_toperator<<= (const uint256_t &value) noexcept
 
uint256_toperator>>= (const uint256_t &value) noexcept
 
template<typename T >
uint256_toperator<<= (const T &value) noexcept
 
template<typename T >
uint256_toperator>>= (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
 
 operator uint128_t () const noexcept
 
uint128_t upper () const noexcept
 Get the upper part of the 256-bit integer. More...
 
uint128_t lower () const noexcept
 Get the lower part of the 256-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 (uint256_t &value) noexcept
 Swap two instances. More...
 

Static Public Member Functions

static std::pair< uint256_t, uint256_tdivmod (const uint256_t &x, const uint256_t &y)
 Calculate quotient and remainder when dividing X by Y. More...
 

Friends

uint128_toperator+= (uint128_t &value1, const uint256_t &value2) noexcept
 
uint128_toperator-= (uint128_t &value1, const uint256_t &value2) noexcept
 
uint128_toperator*= (uint128_t &value1, const uint256_t &value2) noexcept
 
uint128_toperator/= (uint128_t &value1, const uint256_t &value2)
 
uint128_toperator%= (uint128_t &value1, const uint256_t &value2)
 
template<typename T >
T & operator+= (T &value1, const uint256_t &value2) noexcept
 
template<typename T >
T & operator-= (T &value1, const uint256_t &value2) noexcept
 
template<typename T >
T & operator*= (T &value1, const uint256_t &value2) noexcept
 
template<typename T >
T & operator/= (T &value1, const uint256_t &value2)
 
template<typename T >
T & operator%= (T &value1, const uint256_t &value2)
 
template<typename T >
uint256_t operator+ (const T &value1, const uint256_t &value2) noexcept
 
template<typename T >
uint256_t operator+ (const uint256_t &value1, const T &value2) noexcept
 
uint256_t operator+ (const uint128_t &value1, const uint256_t &value2) noexcept
 
uint256_t operator+ (const uint256_t &value1, const uint128_t &value2) noexcept
 
uint256_t operator+ (const uint256_t &value1, const uint256_t &value2) noexcept
 
template<typename T >
uint256_t operator- (const T &value1, const uint256_t &value2) noexcept
 
template<typename T >
uint256_t operator- (const uint256_t &value1, const T &value2) noexcept
 
uint256_t operator- (const uint128_t &value1, const uint256_t &value2) noexcept
 
uint256_t operator- (const uint256_t &value1, const uint128_t &value2) noexcept
 
uint256_t operator- (const uint256_t &value1, const uint256_t &value2) noexcept
 
template<typename T >
uint256_t operator* (const T &value1, const uint256_t &value2) noexcept
 
template<typename T >
uint256_t operator* (const uint256_t &value1, const T &value2) noexcept
 
uint256_t operator* (const uint128_t &value1, const uint256_t &value2) noexcept
 
uint256_t operator* (const uint256_t &value1, const uint128_t &value2) noexcept
 
uint256_t operator* (const uint256_t &value1, const uint256_t &value2) noexcept
 
template<typename T >
uint256_t operator/ (const T &value1, const uint256_t &value2)
 
template<typename T >
uint256_t operator/ (const uint256_t &value1, const T &value2)
 
uint256_t operator/ (const uint128_t &value1, const uint256_t &value2)
 
uint256_t operator/ (const uint256_t &value1, const uint128_t &value2)
 
uint256_t operator/ (const uint256_t &value1, const uint256_t &value2)
 
template<typename T >
uint256_t operator% (const T &value1, const uint256_t &value2)
 
template<typename T >
uint256_t operator% (const uint256_t &value1, const T &value2)
 
uint256_t operator% (const uint128_t &value1, const uint256_t &value2)
 
uint256_t operator% (const uint256_t &value1, const uint128_t &value2)
 
uint256_t operator% (const uint256_t &value1, const uint256_t &value2)
 
uint128_toperator&= (uint128_t &value1, const uint256_t &value2) noexcept
 
uint128_toperator|= (uint128_t &value1, const uint256_t &value2) noexcept
 
uint128_toperator^= (uint128_t &value1, const uint256_t &value2) noexcept
 
template<typename T >
T & operator&= (T &value1, const uint256_t &value2) noexcept
 
template<typename T >
T & operator|= (T &value1, const uint256_t &value2) noexcept
 
template<typename T >
T & operator^= (T &value1, const uint256_t &value2) noexcept
 
template<typename T >
uint256_t operator& (const T &value1, const uint256_t &value2) noexcept
 
template<typename T >
uint256_t operator& (const uint256_t &value1, const T &value2) noexcept
 
uint256_t operator& (const uint128_t &value1, const uint256_t &value2) noexcept
 
uint256_t operator& (const uint256_t &value1, const uint128_t &value2) noexcept
 
uint256_t operator& (const uint256_t &value1, const uint256_t &value2) noexcept
 
template<typename T >
uint256_t operator| (const T &value1, const uint256_t &value2) noexcept
 
template<typename T >
uint256_t operator| (const uint256_t &value1, const T &value2) noexcept
 
uint256_t operator| (const uint128_t &value1, const uint256_t &value2) noexcept
 
uint256_t operator| (const uint256_t &value1, const uint128_t &value2) noexcept
 
uint256_t operator| (const uint256_t &value1, const uint256_t &value2) noexcept
 
template<typename T >
uint256_t operator^ (const T &value1, const uint256_t &value2) noexcept
 
template<typename T >
uint256_t operator^ (const uint256_t &value1, const T &value2) noexcept
 
uint256_t operator^ (const uint128_t &value1, const uint256_t &value2) noexcept
 
uint256_t operator^ (const uint256_t &value1, const uint128_t &value2) noexcept
 
uint256_t operator^ (const uint256_t &value1, const uint256_t &value2) noexcept
 
template<typename T >
bool operator== (const T &value1, const uint256_t &value2) noexcept
 
template<typename T >
bool operator== (const uint256_t &value1, const T &value2) noexcept
 
bool operator== (const uint128_t &value1, const uint256_t &value2) noexcept
 
bool operator== (const uint256_t &value1, const uint128_t &value2) noexcept
 
bool operator== (const uint256_t &value1, const uint256_t &value2) noexcept
 
template<typename T >
bool operator!= (const T &value1, const uint256_t &value2) noexcept
 
template<typename T >
bool operator!= (const uint256_t &value1, const T &value2) noexcept
 
bool operator!= (const uint128_t &value1, const uint256_t &value2) noexcept
 
bool operator!= (const uint256_t &value1, const uint128_t &value2) noexcept
 
bool operator!= (const uint256_t &value1, const uint256_t &value2) noexcept
 
template<typename T >
bool operator< (const T &value1, const uint256_t &value2) noexcept
 
template<typename T >
bool operator< (const uint256_t &value1, const T &value2) noexcept
 
bool operator< (const uint128_t &value1, const uint256_t &value2) noexcept
 
bool operator< (const uint256_t &value1, const uint128_t &value2) noexcept
 
bool operator< (const uint256_t &value1, const uint256_t &value2) noexcept
 
template<typename T >
bool operator> (const T &value1, const uint256_t &value2) noexcept
 
template<typename T >
bool operator> (const uint256_t &value1, const T &value2) noexcept
 
bool operator> (const uint128_t &value1, const uint256_t &value2) noexcept
 
bool operator> (const uint256_t &value1, const uint128_t &value2) noexcept
 
bool operator> (const uint256_t &value1, const uint256_t &value2) noexcept
 
template<typename T >
bool operator<= (const T &value1, const uint256_t &value2) noexcept
 
template<typename T >
bool operator<= (const uint256_t &value1, const T &value2) noexcept
 
bool operator<= (const uint128_t &value1, const uint256_t &value2) noexcept
 
bool operator<= (const uint256_t &value1, const uint128_t &value2) noexcept
 
bool operator<= (const uint256_t &value1, const uint256_t &value2) noexcept
 
template<typename T >
bool operator>= (const T &value1, const uint256_t &value2) noexcept
 
template<typename T >
bool operator>= (const uint256_t &value1, const T &value2) noexcept
 
bool operator>= (const uint128_t &value1, const uint256_t &value2) noexcept
 
bool operator>= (const uint256_t &value1, const uint128_t &value2) noexcept
 
bool operator>= (const uint256_t &value1, const uint256_t &value2) noexcept
 
template<typename T >
bool operator&& (const T &value1, const uint256_t &value2) noexcept
 
template<typename T >
bool operator&& (const uint256_t &value1, const T &value2) noexcept
 
bool operator&& (const uint128_t &value1, const uint256_t &value2) noexcept
 
bool operator&& (const uint256_t &value1, const uint128_t &value2) noexcept
 
bool operator&& (const uint256_t &value1, const uint256_t &value2) noexcept
 
template<typename T >
bool operator|| (const T &value1, const uint256_t &value2) noexcept
 
template<typename T >
bool operator|| (const uint256_t &value1, const T &value2) noexcept
 
bool operator|| (const uint128_t &value1, const uint256_t &value2) noexcept
 
bool operator|| (const uint256_t &value1, const uint128_t &value2) noexcept
 
bool operator|| (const uint256_t &value1, const uint256_t &value2) noexcept
 
template<typename T >
T & operator<<= (T &value1, const uint256_t &value2) noexcept
 
uint128_toperator<<= (uint128_t &value1, const uint256_t &value2) noexcept
 
uint128_toperator>>= (uint128_t &value1, const uint256_t &value2) noexcept
 
template<typename T >
T & operator>>= (T &value1, const uint256_t &value2) noexcept
 
template<typename T >
uint256_t operator<< (const uint256_t &value1, const T &value2) noexcept
 
uint256_t operator<< (bool value1, const uint256_t &value2) noexcept
 
uint256_t operator<< (int8_t value1, const uint256_t &value2) noexcept
 
uint256_t operator<< (int16_t value1, const uint256_t &value2) noexcept
 
uint256_t operator<< (int32_t value1, const uint256_t &value2) noexcept
 
uint256_t operator<< (int64_t value1, const uint256_t &value2) noexcept
 
uint256_t operator<< (uint8_t value1, const uint256_t &value2) noexcept
 
uint256_t operator<< (uint16_t value1, const uint256_t &value2) noexcept
 
uint256_t operator<< (uint32_t value1, const uint256_t &value2) noexcept
 
uint256_t operator<< (uint64_t value1, const uint256_t &value2) noexcept
 
uint256_t operator<< (const uint128_t &value1, const uint256_t &value2) noexcept
 
uint256_t operator<< (const uint256_t &value1, const uint256_t &value2) noexcept
 
template<typename T >
uint256_t operator>> (const uint256_t &value1, const T &value2) noexcept
 
uint256_t operator>> (bool value1, const uint256_t &value2) noexcept
 
uint256_t operator>> (int8_t value1, const uint256_t &value2) noexcept
 
uint256_t operator>> (int16_t value1, const uint256_t &value2) noexcept
 
uint256_t operator>> (int32_t value1, const uint256_t &value2) noexcept
 
uint256_t operator>> (int64_t value1, const uint256_t &value2) noexcept
 
uint256_t operator>> (uint8_t value1, const uint256_t &value2) noexcept
 
uint256_t operator>> (uint16_t value1, const uint256_t &value2) noexcept
 
uint256_t operator>> (uint32_t value1, const uint256_t &value2) noexcept
 
uint256_t operator>> (uint64_t value1, const uint256_t &value2) noexcept
 
uint256_t operator>> (const uint128_t &value1, const uint256_t &value2) noexcept
 
uint256_t operator>> (const uint256_t &value1, const uint256_t &value2) noexcept
 
std::istream & operator>> (std::istream &is, uint256_t &value)
 Input instance from the given input stream. More...
 
std::wistream & operator>> (std::wistream &is, uint256_t &value)
 Input instance from the given wide input stream. More...
 
std::ostream & operator<< (std::ostream &os, const uint256_t &value)
 Output instance into the given output stream. More...
 
std::wostream & operator<< (std::wostream &os, const uint256_t &value)
 Output instance into the given wide output stream. More...
 
void swap (uint256_t &value1, uint256_t &value2) noexcept
 

Detailed Description

Unsigned 256-bit integer type.

Represents unsigned 256-bit integer type and provides basic arithmetic operations.

Examples
common_uint256.cpp.

Definition at line 20 of file uint256.h.

Constructor & Destructor Documentation

◆ uint256_t() [1/15]

CppCommon::uint256_t::uint256_t ( )
inlinenoexcept

Definition at line 11 of file uint256.inl.

◆ uint256_t() [2/15]

CppCommon::uint256_t::uint256_t ( int8_t  value)
inlinenoexcept

Definition at line 16 of file uint256.inl.

◆ uint256_t() [3/15]

CppCommon::uint256_t::uint256_t ( uint8_t  value)
inlinenoexcept

Definition at line 21 of file uint256.inl.

◆ uint256_t() [4/15]

CppCommon::uint256_t::uint256_t ( int16_t  value)
inlinenoexcept

Definition at line 26 of file uint256.inl.

◆ uint256_t() [5/15]

CppCommon::uint256_t::uint256_t ( uint16_t  value)
inlinenoexcept

Definition at line 31 of file uint256.inl.

◆ uint256_t() [6/15]

CppCommon::uint256_t::uint256_t ( int32_t  value)
inlinenoexcept

Definition at line 36 of file uint256.inl.

◆ uint256_t() [7/15]

CppCommon::uint256_t::uint256_t ( uint32_t  value)
inlinenoexcept

Definition at line 41 of file uint256.inl.

◆ uint256_t() [8/15]

CppCommon::uint256_t::uint256_t ( int64_t  value)
inlinenoexcept

Definition at line 46 of file uint256.inl.

◆ uint256_t() [9/15]

CppCommon::uint256_t::uint256_t ( uint64_t  value)
inlinenoexcept

Definition at line 51 of file uint256.inl.

◆ uint256_t() [10/15]

CppCommon::uint256_t::uint256_t ( uint128_t  value)
inlinenoexcept

Definition at line 56 of file uint256.inl.

◆ uint256_t() [11/15]

template<typename T >
CppCommon::uint256_t::uint256_t ( const T &  value)
inlineexplicitnoexcept

Definition at line 62 of file uint256.inl.

◆ uint256_t() [12/15]

template<typename TUpper , typename TLower >
CppCommon::uint256_t::uint256_t ( const TUpper &  upper,
const TLower &  lower 
)
inlinenoexcept

Definition at line 69 of file uint256.inl.

◆ uint256_t() [13/15]

template<typename TUpperUpper , typename TUpperLower , typename TLowerUpper , typename TLowerLower >
CppCommon::uint256_t::uint256_t ( const TUpperUpper &  upper_upper,
const TUpperLower &  upper_lower,
const TLowerUpper &  lower_upper,
const TLowerLower &  lower_lower 
)
inlinenoexcept

Definition at line 76 of file uint256.inl.

◆ uint256_t() [14/15]

CppCommon::uint256_t::uint256_t ( const uint256_t )
defaultnoexcept

◆ uint256_t() [15/15]

CppCommon::uint256_t::uint256_t ( uint256_t &&  )
defaultnoexcept

◆ ~uint256_t()

CppCommon::uint256_t::~uint256_t ( )
defaultnoexcept

Member Function Documentation

◆ bits()

size_t CppCommon::uint256_t::bits ( ) const
noexcept

Get the count of bits.

Definition at line 83 of file uint256.cpp.

◆ divmod()

std::pair< uint256_t, uint256_t > CppCommon::uint256_t::divmod ( const uint256_t x,
const uint256_t y 
)
static

Calculate quotient and remainder when dividing X by Y.

Parameters
x- X value
y- Y value
Returns
Quotient and remainder pair

Definition at line 160 of file uint256.cpp.

◆ lower()

uint128_t CppCommon::uint256_t::lower ( ) const
inlinenoexcept

Get the lower part of the 256-bit integer.

Definition at line 304 of file uint256.h.

◆ operator bool()

CppCommon::uint256_t::operator bool ( ) const
inlinenoexcept

Definition at line 294 of file uint256.h.

◆ operator uint128_t()

CppCommon::uint256_t::operator uint128_t ( ) const
inlinenoexcept

Definition at line 299 of file uint256.h.

◆ operator uint16_t()

CppCommon::uint256_t::operator uint16_t ( ) const
inlinenoexcept

Definition at line 296 of file uint256.h.

◆ operator uint32_t()

CppCommon::uint256_t::operator uint32_t ( ) const
inlinenoexcept

Definition at line 297 of file uint256.h.

◆ operator uint64_t()

CppCommon::uint256_t::operator uint64_t ( ) const
inlinenoexcept

Definition at line 298 of file uint256.h.

◆ operator uint8_t()

CppCommon::uint256_t::operator uint8_t ( ) const
inlinenoexcept

Definition at line 295 of file uint256.h.

◆ operator!()

bool CppCommon::uint256_t::operator! ( ) const
inlinenoexcept

Definition at line 230 of file uint256.h.

◆ operator%=() [1/2]

template<typename T >
uint256_t& CppCommon::uint256_t::operator%= ( const T &  value)
inline

Definition at line 72 of file uint256.h.

◆ operator%=() [2/2]

uint256_t& CppCommon::uint256_t::operator%= ( const uint256_t value)
inline

Definition at line 61 of file uint256.h.

◆ operator&=() [1/2]

template<typename T >
uint256_t& CppCommon::uint256_t::operator&= ( const T &  value)
inlinenoexcept

Definition at line 139 of file uint256.h.

◆ operator&=() [2/2]

uint256_t& CppCommon::uint256_t::operator&= ( const uint256_t value)
inlinenoexcept

Definition at line 134 of file uint256.h.

◆ operator*=() [1/2]

template<typename T >
uint256_t& CppCommon::uint256_t::operator*= ( const T &  value)
inlinenoexcept

Definition at line 68 of file uint256.h.

◆ operator*=() [2/2]

uint256_t& CppCommon::uint256_t::operator*= ( const uint256_t value)
inlinenoexcept

Definition at line 59 of file uint256.h.

◆ operator+()

uint256_t CppCommon::uint256_t::operator+ ( ) const
inlinenoexcept

Definition at line 49 of file uint256.h.

◆ operator++() [1/2]

uint256_t& CppCommon::uint256_t::operator++ ( )
inlinenoexcept

Definition at line 52 of file uint256.h.

◆ operator++() [2/2]

uint256_t CppCommon::uint256_t::operator++ ( int  )
inlinenoexcept

Definition at line 53 of file uint256.h.

◆ operator+=() [1/2]

template<typename T >
uint256_t& CppCommon::uint256_t::operator+= ( const T &  value)
inlinenoexcept

Definition at line 64 of file uint256.h.

◆ operator+=() [2/2]

uint256_t& CppCommon::uint256_t::operator+= ( const uint256_t value)
inlinenoexcept

Definition at line 57 of file uint256.h.

◆ operator-()

uint256_t CppCommon::uint256_t::operator- ( ) const
inlinenoexcept

Definition at line 50 of file uint256.h.

◆ operator--() [1/2]

uint256_t& CppCommon::uint256_t::operator-- ( )
inlinenoexcept

Definition at line 54 of file uint256.h.

◆ operator--() [2/2]

uint256_t CppCommon::uint256_t::operator-- ( int  )
inlinenoexcept

Definition at line 55 of file uint256.h.

◆ operator-=() [1/2]

template<typename T >
uint256_t& CppCommon::uint256_t::operator-= ( const T &  value)
inlinenoexcept

Definition at line 66 of file uint256.h.

◆ operator-=() [2/2]

uint256_t& CppCommon::uint256_t::operator-= ( const uint256_t value)
inlinenoexcept

Definition at line 58 of file uint256.h.

◆ operator/=() [1/2]

template<typename T >
uint256_t& CppCommon::uint256_t::operator/= ( const T &  value)
inline

Definition at line 70 of file uint256.h.

◆ operator/=() [2/2]

uint256_t& CppCommon::uint256_t::operator/= ( const uint256_t value)
inline

Definition at line 60 of file uint256.h.

◆ operator<<=() [1/2]

template<typename T >
uint256_t& CppCommon::uint256_t::operator<<= ( const T &  value)
inlinenoexcept

Definition at line 253 of file uint256.h.

◆ operator<<=() [2/2]

uint256_t& CppCommon::uint256_t::operator<<= ( const uint256_t value)
inlinenoexcept

Definition at line 249 of file uint256.h.

◆ operator=() [1/3]

template<typename T >
uint256_t & CppCommon::uint256_t::operator= ( const T &  value)
inlinenoexcept

Definition at line 83 of file uint256.inl.

◆ operator=() [2/3]

uint256_t& CppCommon::uint256_t::operator= ( const uint256_t )
defaultnoexcept

◆ operator=() [3/3]

uint256_t& CppCommon::uint256_t::operator= ( uint256_t &&  )
defaultnoexcept

◆ operator>>=() [1/2]

template<typename T >
uint256_t& CppCommon::uint256_t::operator>>= ( const T &  value)
inlinenoexcept

Definition at line 261 of file uint256.h.

◆ operator>>=() [2/2]

uint256_t& CppCommon::uint256_t::operator>>= ( const uint256_t value)
inlinenoexcept

Definition at line 250 of file uint256.h.

◆ operator^=() [1/2]

template<typename T >
uint256_t& CppCommon::uint256_t::operator^= ( const T &  value)
inlinenoexcept

Definition at line 143 of file uint256.h.

◆ operator^=() [2/2]

uint256_t& CppCommon::uint256_t::operator^= ( const uint256_t value)
inlinenoexcept

Definition at line 136 of file uint256.h.

◆ operator|=() [1/2]

template<typename T >
uint256_t& CppCommon::uint256_t::operator|= ( const T &  value)
inlinenoexcept

Definition at line 141 of file uint256.h.

◆ operator|=() [2/2]

uint256_t& CppCommon::uint256_t::operator|= ( const uint256_t value)
inlinenoexcept

Definition at line 135 of file uint256.h.

◆ operator~()

uint256_t CppCommon::uint256_t::operator~ ( ) const
inlinenoexcept

Definition at line 132 of file uint256.h.

◆ string()

std::string CppCommon::uint256_t::string ( size_t  base = 10,
size_t  length = 0 
) const

Get string from the current 128-bit integer.

Parameters
base- Conversion base in range [2, 16] (default is 10)
length- Minimal string length (default is 0)
Returns
Result string

Definition at line 110 of file uint256.cpp.

◆ swap()

void CppCommon::uint256_t::swap ( uint256_t value)
inlinenoexcept

Swap two instances.

Definition at line 189 of file uint256.inl.

◆ upper()

uint128_t CppCommon::uint256_t::upper ( ) const
inlinenoexcept

Get the upper part of the 256-bit integer.

Definition at line 302 of file uint256.h.

◆ wstring()

std::wstring CppCommon::uint256_t::wstring ( size_t  base = 10,
size_t  length = 0 
) const

Get wide string from the current 128-bit integer.

Parameters
base- Conversion base in range [2, 16] (default is 10)
length- Minimal string length (default is 0)
Returns
Result wide string

Definition at line 135 of file uint256.cpp.

Friends And Related Function Documentation

◆ operator!= [1/5]

template<typename T >
bool operator!= ( const T &  value1,
const uint256_t value2 
)
friend

Definition at line 190 of file uint256.h.

◆ operator!= [2/5]

bool operator!= ( const uint128_t value1,
const uint256_t value2 
)
friend

Definition at line 193 of file uint256.h.

◆ operator!= [3/5]

template<typename T >
bool operator!= ( const uint256_t value1,
const T &  value2 
)
friend

Definition at line 192 of file uint256.h.

◆ operator!= [4/5]

bool operator!= ( const uint256_t value1,
const uint128_t value2 
)
friend

Definition at line 194 of file uint256.h.

◆ operator!= [5/5]

bool operator!= ( const uint256_t value1,
const uint256_t value2 
)
friend

Definition at line 132 of file uint256.inl.

◆ operator% [1/5]

template<typename T >
uint256_t operator% ( const T &  value1,
const uint256_t value2 
)
friend

Definition at line 124 of file uint256.h.

◆ operator% [2/5]

uint256_t operator% ( const uint128_t value1,
const uint256_t value2 
)
friend

Definition at line 127 of file uint256.h.

◆ operator% [3/5]

template<typename T >
uint256_t operator% ( const uint256_t value1,
const T &  value2 
)
friend

Definition at line 126 of file uint256.h.

◆ operator% [4/5]

uint256_t operator% ( const uint256_t value1,
const uint128_t value2 
)
friend

Definition at line 128 of file uint256.h.

◆ operator% [5/5]

uint256_t operator% ( const uint256_t value1,
const uint256_t value2 
)
friend

Definition at line 107 of file uint256.inl.

◆ operator%= [1/2]

template<typename T >
T& operator%= ( T &  value1,
const uint256_t value2 
)
friend

Definition at line 89 of file uint256.h.

◆ operator%= [2/2]

uint128_t& operator%= ( uint128_t value1,
const uint256_t value2 
)
friend

Definition at line 78 of file uint256.h.

◆ operator& [1/5]

template<typename T >
uint256_t operator& ( const T &  value1,
const uint256_t value2 
)
friend

Definition at line 157 of file uint256.h.

◆ operator& [2/5]

uint256_t operator& ( const uint128_t value1,
const uint256_t value2 
)
friend

Definition at line 160 of file uint256.h.

◆ operator& [3/5]

template<typename T >
uint256_t operator& ( const uint256_t value1,
const T &  value2 
)
friend

Definition at line 159 of file uint256.h.

◆ operator& [4/5]

uint256_t operator& ( const uint256_t value1,
const uint128_t value2 
)
friend

Definition at line 161 of file uint256.h.

◆ operator& [5/5]

uint256_t operator& ( const uint256_t value1,
const uint256_t value2 
)
friend

Definition at line 112 of file uint256.inl.

◆ operator&& [1/5]

template<typename T >
bool operator&& ( const T &  value1,
const uint256_t value2 
)
friend

Definition at line 233 of file uint256.h.

◆ operator&& [2/5]

bool operator&& ( const uint128_t value1,
const uint256_t value2 
)
friend

Definition at line 236 of file uint256.h.

◆ operator&& [3/5]

template<typename T >
bool operator&& ( const uint256_t value1,
const T &  value2 
)
friend

Definition at line 235 of file uint256.h.

◆ operator&& [4/5]

bool operator&& ( const uint256_t value1,
const uint128_t value2 
)
friend

Definition at line 237 of file uint256.h.

◆ operator&& [5/5]

bool operator&& ( const uint256_t value1,
const uint256_t value2 
)
friend

Definition at line 157 of file uint256.inl.

◆ operator&= [1/2]

template<typename T >
T& operator&= ( T &  value1,
const uint256_t value2 
)
friend

Definition at line 150 of file uint256.h.

◆ operator&= [2/2]

uint128_t& operator&= ( uint128_t value1,
const uint256_t value2 
)
friend

Definition at line 145 of file uint256.h.

◆ operator* [1/5]

template<typename T >
uint256_t operator* ( const T &  value1,
const uint256_t value2 
)
friend

Definition at line 108 of file uint256.h.

◆ operator* [2/5]

uint256_t operator* ( const uint128_t value1,
const uint256_t value2 
)
friend

Definition at line 111 of file uint256.h.

◆ operator* [3/5]

template<typename T >
uint256_t operator* ( const uint256_t value1,
const T &  value2 
)
friend

Definition at line 110 of file uint256.h.

◆ operator* [4/5]

uint256_t operator* ( const uint256_t value1,
const uint128_t value2 
)
friend

Definition at line 112 of file uint256.h.

◆ operator* [5/5]

uint256_t operator* ( const uint256_t value1,
const uint256_t value2 
)
friend

Definition at line 13 of file uint256.cpp.

◆ operator*= [1/2]

template<typename T >
T& operator*= ( T &  value1,
const uint256_t value2 
)
friend

Definition at line 85 of file uint256.h.

◆ operator*= [2/2]

uint128_t& operator*= ( uint128_t value1,
const uint256_t value2 
)
friend

Definition at line 76 of file uint256.h.

◆ operator+ [1/5]

template<typename T >
uint256_t operator+ ( const T &  value1,
const uint256_t value2 
)
friend

Definition at line 92 of file uint256.h.

◆ operator+ [2/5]

uint256_t operator+ ( const uint128_t value1,
const uint256_t value2 
)
friend

Definition at line 95 of file uint256.h.

◆ operator+ [3/5]

template<typename T >
uint256_t operator+ ( const uint256_t value1,
const T &  value2 
)
friend

Definition at line 94 of file uint256.h.

◆ operator+ [4/5]

uint256_t operator+ ( const uint256_t value1,
const uint128_t value2 
)
friend

Definition at line 96 of file uint256.h.

◆ operator+ [5/5]

uint256_t operator+ ( const uint256_t value1,
const uint256_t value2 
)
friend

Definition at line 92 of file uint256.inl.

◆ operator+= [1/2]

template<typename T >
T& operator+= ( T &  value1,
const uint256_t value2 
)
friend

Definition at line 81 of file uint256.h.

◆ operator+= [2/2]

uint128_t& operator+= ( uint128_t value1,
const uint256_t value2 
)
friend

Definition at line 74 of file uint256.h.

◆ operator- [1/5]

template<typename T >
uint256_t operator- ( const T &  value1,
const uint256_t value2 
)
friend

Definition at line 100 of file uint256.h.

◆ operator- [2/5]

uint256_t operator- ( const uint128_t value1,
const uint256_t value2 
)
friend

Definition at line 103 of file uint256.h.

◆ operator- [3/5]

template<typename T >
uint256_t operator- ( const uint256_t value1,
const T &  value2 
)
friend

Definition at line 102 of file uint256.h.

◆ operator- [4/5]

uint256_t operator- ( const uint256_t value1,
const uint128_t value2 
)
friend

Definition at line 104 of file uint256.h.

◆ operator- [5/5]

uint256_t operator- ( const uint256_t value1,
const uint256_t value2 
)
friend

Definition at line 97 of file uint256.inl.

◆ operator-= [1/2]

template<typename T >
T& operator-= ( T &  value1,
const uint256_t value2 
)
friend

Definition at line 83 of file uint256.h.

◆ operator-= [2/2]

uint128_t& operator-= ( uint128_t value1,
const uint256_t value2 
)
friend

Definition at line 75 of file uint256.h.

◆ operator/ [1/5]

template<typename T >
uint256_t operator/ ( const T &  value1,
const uint256_t value2 
)
friend

Definition at line 116 of file uint256.h.

◆ operator/ [2/5]

uint256_t operator/ ( const uint128_t value1,
const uint256_t value2 
)
friend

Definition at line 119 of file uint256.h.

◆ operator/ [3/5]

template<typename T >
uint256_t operator/ ( const uint256_t value1,
const T &  value2 
)
friend

Definition at line 118 of file uint256.h.

◆ operator/ [4/5]

uint256_t operator/ ( const uint256_t value1,
const uint128_t value2 
)
friend

Definition at line 120 of file uint256.h.

◆ operator/ [5/5]

uint256_t operator/ ( const uint256_t value1,
const uint256_t value2 
)
friend

Definition at line 102 of file uint256.inl.

◆ operator/= [1/2]

template<typename T >
T& operator/= ( T &  value1,
const uint256_t value2 
)
friend

Definition at line 87 of file uint256.h.

◆ operator/= [2/2]

uint128_t& operator/= ( uint128_t value1,
const uint256_t value2 
)
friend

Definition at line 77 of file uint256.h.

◆ operator< [1/5]

template<typename T >
bool operator< ( const T &  value1,
const uint256_t value2 
)
friend

Definition at line 198 of file uint256.h.

◆ operator< [2/5]

bool operator< ( const uint128_t value1,
const uint256_t value2 
)
friend

Definition at line 201 of file uint256.h.

◆ operator< [3/5]

template<typename T >
bool operator< ( const uint256_t value1,
const T &  value2 
)
friend

Definition at line 200 of file uint256.h.

◆ operator< [4/5]

bool operator< ( const uint256_t value1,
const uint128_t value2 
)
friend

Definition at line 202 of file uint256.h.

◆ operator< [5/5]

bool operator< ( const uint256_t value1,
const uint256_t value2 
)
friend

Definition at line 137 of file uint256.inl.

◆ operator<< [1/14]

uint256_t operator<< ( bool  value1,
const uint256_t value2 
)
friend

Definition at line 267 of file uint256.h.

◆ operator<< [2/14]

uint256_t operator<< ( const uint128_t value1,
const uint256_t value2 
)
friend

Definition at line 276 of file uint256.h.

◆ operator<< [3/14]

template<typename T >
uint256_t operator<< ( const uint256_t value1,
const T &  value2 
)
friend

Definition at line 266 of file uint256.h.

◆ operator<< [4/14]

uint256_t operator<< ( const uint256_t value1,
const uint256_t value2 
)
friend

Definition at line 47 of file uint256.cpp.

◆ operator<< [5/14]

uint256_t operator<< ( int16_t  value1,
const uint256_t value2 
)
friend

Definition at line 269 of file uint256.h.

◆ operator<< [6/14]

uint256_t operator<< ( int32_t  value1,
const uint256_t value2 
)
friend

Definition at line 270 of file uint256.h.

◆ operator<< [7/14]

uint256_t operator<< ( int64_t  value1,
const uint256_t value2 
)
friend

Definition at line 271 of file uint256.h.

◆ operator<< [8/14]

uint256_t operator<< ( int8_t  value1,
const uint256_t value2 
)
friend

Definition at line 268 of file uint256.h.

◆ operator<< [9/14]

std::ostream& operator<< ( std::ostream &  os,
const uint256_t value 
)
friend

Output instance into the given output stream.

Definition at line 167 of file uint256.inl.

◆ operator<< [10/14]

std::wostream& operator<< ( std::wostream &  os,
const uint256_t value 
)
friend

Output instance into the given wide output stream.

Definition at line 178 of file uint256.inl.

◆ operator<< [11/14]

uint256_t operator<< ( uint16_t  value1,
const uint256_t value2 
)
friend

Definition at line 273 of file uint256.h.

◆ operator<< [12/14]

uint256_t operator<< ( uint32_t  value1,
const uint256_t value2 
)
friend

Definition at line 274 of file uint256.h.

◆ operator<< [13/14]

uint256_t operator<< ( uint64_t  value1,
const uint256_t value2 
)
friend

Definition at line 275 of file uint256.h.

◆ operator<< [14/14]

uint256_t operator<< ( uint8_t  value1,
const uint256_t value2 
)
friend

Definition at line 272 of file uint256.h.

◆ operator<<= [1/2]

template<typename T >
T& operator<<= ( T &  value1,
const uint256_t value2 
)
friend

Definition at line 255 of file uint256.h.

◆ operator<<= [2/2]

uint128_t& operator<<= ( uint128_t value1,
const uint256_t value2 
)
friend

Definition at line 257 of file uint256.h.

◆ operator<= [1/5]

template<typename T >
bool operator<= ( const T &  value1,
const uint256_t value2 
)
friend

Definition at line 214 of file uint256.h.

◆ operator<= [2/5]

bool operator<= ( const uint128_t value1,
const uint256_t value2 
)
friend

Definition at line 217 of file uint256.h.

◆ operator<= [3/5]

template<typename T >
bool operator<= ( const uint256_t value1,
const T &  value2 
)
friend

Definition at line 216 of file uint256.h.

◆ operator<= [4/5]

bool operator<= ( const uint256_t value1,
const uint128_t value2 
)
friend

Definition at line 218 of file uint256.h.

◆ operator<= [5/5]

bool operator<= ( const uint256_t value1,
const uint256_t value2 
)
friend

Definition at line 147 of file uint256.inl.

◆ operator== [1/5]

template<typename T >
bool operator== ( const T &  value1,
const uint256_t value2 
)
friend

Definition at line 182 of file uint256.h.

◆ operator== [2/5]

bool operator== ( const uint128_t value1,
const uint256_t value2 
)
friend

Definition at line 185 of file uint256.h.

◆ operator== [3/5]

template<typename T >
bool operator== ( const uint256_t value1,
const T &  value2 
)
friend

Definition at line 184 of file uint256.h.

◆ operator== [4/5]

bool operator== ( const uint256_t value1,
const uint128_t value2 
)
friend

Definition at line 186 of file uint256.h.

◆ operator== [5/5]

bool operator== ( const uint256_t value1,
const uint256_t value2 
)
friend

Definition at line 127 of file uint256.inl.

◆ operator> [1/5]

template<typename T >
bool operator> ( const T &  value1,
const uint256_t value2 
)
friend

Definition at line 206 of file uint256.h.

◆ operator> [2/5]

bool operator> ( const uint128_t value1,
const uint256_t value2 
)
friend

Definition at line 209 of file uint256.h.

◆ operator> [3/5]

template<typename T >
bool operator> ( const uint256_t value1,
const T &  value2 
)
friend

Definition at line 208 of file uint256.h.

◆ operator> [4/5]

bool operator> ( const uint256_t value1,
const uint128_t value2 
)
friend

Definition at line 210 of file uint256.h.

◆ operator> [5/5]

bool operator> ( const uint256_t value1,
const uint256_t value2 
)
friend

Definition at line 142 of file uint256.inl.

◆ operator>= [1/5]

template<typename T >
bool operator>= ( const T &  value1,
const uint256_t value2 
)
friend

Definition at line 222 of file uint256.h.

◆ operator>= [2/5]

bool operator>= ( const uint128_t value1,
const uint256_t value2 
)
friend

Definition at line 225 of file uint256.h.

◆ operator>= [3/5]

template<typename T >
bool operator>= ( const uint256_t value1,
const T &  value2 
)
friend

Definition at line 224 of file uint256.h.

◆ operator>= [4/5]

bool operator>= ( const uint256_t value1,
const uint128_t value2 
)
friend

Definition at line 226 of file uint256.h.

◆ operator>= [5/5]

bool operator>= ( const uint256_t value1,
const uint256_t value2 
)
friend

Definition at line 152 of file uint256.inl.

◆ operator>> [1/14]

uint256_t operator>> ( bool  value1,
const uint256_t value2 
)
friend

Definition at line 281 of file uint256.h.

◆ operator>> [2/14]

uint256_t operator>> ( const uint128_t value1,
const uint256_t value2 
)
friend

Definition at line 290 of file uint256.h.

◆ operator>> [3/14]

template<typename T >
uint256_t operator>> ( const uint256_t value1,
const T &  value2 
)
friend

Definition at line 280 of file uint256.h.

◆ operator>> [4/14]

uint256_t operator>> ( const uint256_t value1,
const uint256_t value2 
)
friend

Definition at line 65 of file uint256.cpp.

◆ operator>> [5/14]

uint256_t operator>> ( int16_t  value1,
const uint256_t value2 
)
friend

Definition at line 283 of file uint256.h.

◆ operator>> [6/14]

uint256_t operator>> ( int32_t  value1,
const uint256_t value2 
)
friend

Definition at line 284 of file uint256.h.

◆ operator>> [7/14]

uint256_t operator>> ( int64_t  value1,
const uint256_t value2 
)
friend

Definition at line 285 of file uint256.h.

◆ operator>> [8/14]

uint256_t operator>> ( int8_t  value1,
const uint256_t value2 
)
friend

Definition at line 282 of file uint256.h.

◆ operator>> [9/14]

std::istream& operator>> ( std::istream &  is,
uint256_t value 
)
friend

Input instance from the given input stream.

Definition at line 333 of file uint256.h.

◆ operator>> [10/14]

std::wistream& operator>> ( std::wistream &  is,
uint256_t value 
)
friend

Input instance from the given wide input stream.

Definition at line 336 of file uint256.h.

◆ operator>> [11/14]

uint256_t operator>> ( uint16_t  value1,
const uint256_t value2 
)
friend

Definition at line 287 of file uint256.h.

◆ operator>> [12/14]

uint256_t operator>> ( uint32_t  value1,
const uint256_t value2 
)
friend

Definition at line 288 of file uint256.h.

◆ operator>> [13/14]

uint256_t operator>> ( uint64_t  value1,
const uint256_t value2 
)
friend

Definition at line 289 of file uint256.h.

◆ operator>> [14/14]

uint256_t operator>> ( uint8_t  value1,
const uint256_t value2 
)
friend

Definition at line 286 of file uint256.h.

◆ operator>>= [1/2]

template<typename T >
T& operator>>= ( T &  value1,
const uint256_t value2 
)
friend

Definition at line 263 of file uint256.h.

◆ operator>>= [2/2]

uint128_t& operator>>= ( uint128_t value1,
const uint256_t value2 
)
friend

Definition at line 258 of file uint256.h.

◆ operator^ [1/5]

template<typename T >
uint256_t operator^ ( const T &  value1,
const uint256_t value2 
)
friend

Definition at line 173 of file uint256.h.

◆ operator^ [2/5]

uint256_t operator^ ( const uint128_t value1,
const uint256_t value2 
)
friend

Definition at line 176 of file uint256.h.

◆ operator^ [3/5]

template<typename T >
uint256_t operator^ ( const uint256_t value1,
const T &  value2 
)
friend

Definition at line 175 of file uint256.h.

◆ operator^ [4/5]

uint256_t operator^ ( const uint256_t value1,
const uint128_t value2 
)
friend

Definition at line 177 of file uint256.h.

◆ operator^ [5/5]

uint256_t operator^ ( const uint256_t value1,
const uint256_t value2 
)
friend

Definition at line 122 of file uint256.inl.

◆ operator^= [1/2]

template<typename T >
T& operator^= ( T &  value1,
const uint256_t value2 
)
friend

Definition at line 154 of file uint256.h.

◆ operator^= [2/2]

uint128_t& operator^= ( uint128_t value1,
const uint256_t value2 
)
friend

Definition at line 147 of file uint256.h.

◆ operator| [1/5]

template<typename T >
uint256_t operator| ( const T &  value1,
const uint256_t value2 
)
friend

Definition at line 165 of file uint256.h.

◆ operator| [2/5]

uint256_t operator| ( const uint128_t value1,
const uint256_t value2 
)
friend

Definition at line 168 of file uint256.h.

◆ operator| [3/5]

template<typename T >
uint256_t operator| ( const uint256_t value1,
const T &  value2 
)
friend

Definition at line 167 of file uint256.h.

◆ operator| [4/5]

uint256_t operator| ( const uint256_t value1,
const uint128_t value2 
)
friend

Definition at line 169 of file uint256.h.

◆ operator| [5/5]

uint256_t operator| ( const uint256_t value1,
const uint256_t value2 
)
friend

Definition at line 117 of file uint256.inl.

◆ operator|= [1/2]

template<typename T >
T& operator|= ( T &  value1,
const uint256_t value2 
)
friend

Definition at line 152 of file uint256.h.

◆ operator|= [2/2]

uint128_t& operator|= ( uint128_t value1,
const uint256_t value2 
)
friend

Definition at line 146 of file uint256.h.

◆ operator|| [1/5]

template<typename T >
bool operator|| ( const T &  value1,
const uint256_t value2 
)
friend

Definition at line 241 of file uint256.h.

◆ operator|| [2/5]

bool operator|| ( const uint128_t value1,
const uint256_t value2 
)
friend

Definition at line 244 of file uint256.h.

◆ operator|| [3/5]

template<typename T >
bool operator|| ( const uint256_t value1,
const T &  value2 
)
friend

Definition at line 243 of file uint256.h.

◆ operator|| [4/5]

bool operator|| ( const uint256_t value1,
const uint128_t value2 
)
friend

Definition at line 245 of file uint256.h.

◆ operator|| [5/5]

bool operator|| ( const uint256_t value1,
const uint256_t value2 
)
friend

Definition at line 162 of file uint256.inl.

◆ swap

void swap ( uint256_t value1,
uint256_t value2 
)
friend

Definition at line 196 of file uint256.inl.


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