From 8dbd9fd1c0e5961b1efa2bdbc5b92713243dba55 Mon Sep 17 00:00:00 2001 From: Vladislav Shchapov Date: Mon, 14 Nov 2022 13:16:58 +0500 Subject: [PATCH] Add missing operators Signed-off-by: Vladislav Shchapov --- include/fmt/format.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/fmt/format.h b/include/fmt/format.h index 32976ab90f75f..60200e4aeb720 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -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); @@ -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()) {