forked from fmtlib/fmt
Add missing operators
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
This commit is contained in:
committed by
Victor Zverovich
parent
8276f1a204
commit
74d55a4938
@ -360,6 +360,10 @@ class uint128_fallback {
|
|||||||
-> uint128_fallback {
|
-> uint128_fallback {
|
||||||
return {lhs.hi_ & rhs.hi_, lhs.lo_ & rhs.lo_};
|
return {lhs.hi_ & rhs.hi_, lhs.lo_ & rhs.lo_};
|
||||||
}
|
}
|
||||||
|
friend constexpr auto operator~(const uint128_fallback& n)
|
||||||
|
-> uint128_fallback {
|
||||||
|
return {~n.hi_, ~n.lo_};
|
||||||
|
}
|
||||||
friend auto operator+(const uint128_fallback& lhs,
|
friend auto operator+(const uint128_fallback& lhs,
|
||||||
const uint128_fallback& rhs) -> uint128_fallback {
|
const uint128_fallback& rhs) -> uint128_fallback {
|
||||||
auto result = uint128_fallback(lhs);
|
auto result = uint128_fallback(lhs);
|
||||||
@ -398,6 +402,10 @@ class uint128_fallback {
|
|||||||
lo_ = new_lo;
|
lo_ = new_lo;
|
||||||
hi_ = new_hi;
|
hi_ = new_hi;
|
||||||
}
|
}
|
||||||
|
FMT_CONSTEXPR void operator&=(uint128_fallback n) {
|
||||||
|
lo_ &= n.lo_;
|
||||||
|
hi_ &= n.hi_;
|
||||||
|
}
|
||||||
|
|
||||||
FMT_CONSTEXPR20 uint128_fallback& operator+=(uint64_t n) noexcept {
|
FMT_CONSTEXPR20 uint128_fallback& operator+=(uint64_t n) noexcept {
|
||||||
if (is_constant_evaluated()) {
|
if (is_constant_evaluated()) {
|
||||||
|
Reference in New Issue
Block a user