aboutsummaryrefslogtreecommitdiffstats
path: root/chilbert/FixBitVec.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'chilbert/FixBitVec.hpp')
-rw-r--r--chilbert/FixBitVec.hpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/chilbert/FixBitVec.hpp b/chilbert/FixBitVec.hpp
index e47b868..bba25d9 100644
--- a/chilbert/FixBitVec.hpp
+++ b/chilbert/FixBitVec.hpp
@@ -224,6 +224,9 @@ public:
return static_cast<size_t>(chilbert::ffs(m_rack));
}
+ /// Return the number of set bits
+ size_t count() const { return static_cast<size_t>(pop_count(m_rack)); }
+
/// Flip all bits (one's complement)
CFixBitVec& flip()
{