Skip to content

Commit

Permalink
Add missing operators
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
  • Loading branch information
phprus committed Nov 14, 2022
1 parent 019fa7e commit 8dbd9fd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,10 @@ class uint128_fallback {
-> uint128_fallback {
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,
const uint128_fallback& rhs) -> uint128_fallback {
auto result = uint128_fallback(lhs);
Expand Down Expand Up @@ -398,6 +402,10 @@ class uint128_fallback {
lo_ = new_lo;
hi_ = new_hi;
}
FMT_CONSTEXPR void operator&=(uint128_fallback n) {
lo_ = lo_ & n.lo_;
hi_ = hi_ & n.hi_;
}

FMT_CONSTEXPR20 uint128_fallback& operator+=(uint64_t n) noexcept {
if (is_constant_evaluated()) {
Expand Down

0 comments on commit 8dbd9fd

Please sign in to comment.