aboutsummaryrefslogtreecommitdiffstats
path: root/include/chilbert/detail/MultiBitVec.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/chilbert/detail/MultiBitVec.hpp')
-rw-r--r--include/chilbert/detail/MultiBitVec.hpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/chilbert/detail/MultiBitVec.hpp b/include/chilbert/detail/MultiBitVec.hpp
index bf1802c..1317d3b 100644
--- a/include/chilbert/detail/MultiBitVec.hpp
+++ b/include/chilbert/detail/MultiBitVec.hpp
@@ -111,7 +111,7 @@ public:
/// Clear any bits in storage outside the valid range if necessary
void truncate()
{
- if (const auto pad = num_racks() * bits_per_rack - size()) {
+ if (const auto pad = (num_racks() * bits_per_rack) - size()) {
rack(num_racks() - 1) &= ~Rack{0} >> pad;
}
}
@@ -334,6 +334,10 @@ public:
private:
using Index = detail::BitVecIndex<Derived>;
+ friend Derived;
+
+ MultiBitVec() = default;
+
Derived* self() { return static_cast<Derived*>(this); }
const Derived* self() const { return static_cast<const Derived*>(this); }
};