From fc24951cba40ab471f64f9f2825b4abe541e1283 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 18 Aug 2018 09:06:14 +0200 Subject: Add NOT operators --- chilbert/BigBitVec.hpp | 7 +++++++ chilbert/FixBitVec.hpp | 7 +++++++ 2 files changed, 14 insertions(+) (limited to 'chilbert') diff --git a/chilbert/BigBitVec.hpp b/chilbert/BigBitVec.hpp index 37ef870..30b8f82 100644 --- a/chilbert/BigBitVec.hpp +++ b/chilbert/BigBitVec.hpp @@ -249,6 +249,13 @@ public: return t; } + CBigBitVec operator~() const + { + CBigBitVec t(*this); + t.flip(); + return t; + } + CBigBitVec& operator<<=(const size_t bits) { assert(bits < size()); diff --git a/chilbert/FixBitVec.hpp b/chilbert/FixBitVec.hpp index 0bc2032..05dae1f 100644 --- a/chilbert/FixBitVec.hpp +++ b/chilbert/FixBitVec.hpp @@ -166,6 +166,13 @@ public: return t; } + CFixBitVec operator~() const + { + CFixBitVec t(*this); + t.flip(); + return t; + } + CFixBitVec& operator<<=(const size_t bits) { assert(bits < size()); -- cgit v1.2.1