From 3c45558dfcd471d8af685cea024526a9dd31559b Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Thu, 1 Aug 2019 23:20:17 -0500 Subject: [PATCH] [ox/std] Add bitwise not to strong int --- deps/ox/src/ox/std/strongint.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/deps/ox/src/ox/std/strongint.hpp b/deps/ox/src/ox/std/strongint.hpp index 7ee26108..bd5704dd 100644 --- a/deps/ox/src/ox/std/strongint.hpp +++ b/deps/ox/src/ox/std/strongint.hpp @@ -84,6 +84,8 @@ class Integer: Base { constexpr Integer operator^=(Integer i) noexcept; + constexpr Integer operator~() const noexcept; + // Prefix increment constexpr Integer operator++() noexcept; @@ -246,6 +248,11 @@ constexpr Integer Integer::operator^=(Integer i) noex return Integer(m_i ^= i.m_i); } +template +constexpr inline Integer Integer::operator~() const noexcept { + return Integer(~m_i); +} + // Prefix increment template constexpr inline Integer Integer::operator++() noexcept {