2006-06-15 04:19:30 +00:00
|
|
|
#ifndef _UINT128_H_
|
|
|
|
#define _UINT128_H_
|
|
|
|
|
|
|
|
#include "Types.h"
|
2022-10-21 09:41:23 +01:00
|
|
|
#include <tuple>
|
2006-06-15 04:19:30 +00:00
|
|
|
|
|
|
|
struct uint128
|
|
|
|
{
|
2023-08-18 11:39:36 -04:00
|
|
|
union
|
|
|
|
{
|
2006-06-15 04:19:30 +00:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
uint32 nV[4];
|
|
|
|
};
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
uint32 nV0;
|
|
|
|
uint32 nV1;
|
|
|
|
uint32 nV2;
|
|
|
|
uint32 nV3;
|
|
|
|
};
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
uint64 nD0;
|
|
|
|
uint64 nD1;
|
|
|
|
};
|
|
|
|
};
|
2022-10-21 09:41:23 +01:00
|
|
|
|
|
|
|
inline bool operator<(const uint128& rhs) const
|
|
|
|
{
|
|
|
|
const auto& lhs = (*this);
|
|
|
|
return std::tie(lhs.nD1, lhs.nD0) < std::tie(rhs.nD1, rhs.nD0);
|
|
|
|
}
|
|
|
|
|
|
|
|
inline bool operator==(const uint128& rhs) const
|
|
|
|
{
|
|
|
|
const auto& lhs = (*this);
|
|
|
|
return std::tie(lhs.nD1, lhs.nD0) == std::tie(rhs.nD1, rhs.nD0);
|
|
|
|
}
|
2006-06-15 04:19:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|