diff options
Diffstat (limited to 'toolsrc/include')
| -rw-r--r-- | toolsrc/include/vcpkg/base/uint128.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/toolsrc/include/vcpkg/base/uint128.h b/toolsrc/include/vcpkg/base/uint128.h new file mode 100644 index 000000000..6b7816760 --- /dev/null +++ b/toolsrc/include/vcpkg/base/uint128.h @@ -0,0 +1,26 @@ +#pragma once + +#include <stdint.h> + +namespace vcpkg { + +struct UInt128 { + UInt128() = default; + UInt128(uint64_t value) : bottom(value), top(0) {} + + UInt128& operator<<=(int by) noexcept; + UInt128& operator>>=(int by) noexcept; + UInt128& operator+=(uint64_t lhs) noexcept; + + uint64_t bottom_64_bits() const noexcept { + return bottom; + } + uint64_t top_64_bits() const noexcept { + return top; + } +private: + uint64_t bottom; + uint64_t top; +}; + +} |
