aboutsummaryrefslogtreecommitdiffstats
path: root/chilbert/FixBitVec.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-08-12 22:28:21 +0200
committerDavid Robillard <d@drobilla.net>2018-09-29 14:46:28 +0200
commit1d93b32df165b1ad96b2d1b17d553eb2a37b696c (patch)
treef15f9c821f9d0d2120ec5e4f7495ce8ab4ea3487 /chilbert/FixBitVec.hpp
parentc28ab4461fd7868cff200283cc4cf6aded0f331f (diff)
downloadchilbert-1d93b32df165b1ad96b2d1b17d553eb2a37b696c.tar.gz
chilbert-1d93b32df165b1ad96b2d1b17d553eb2a37b696c.tar.bz2
chilbert-1d93b32df165b1ad96b2d1b17d553eb2a37b696c.zip
Add print operators
Diffstat (limited to 'chilbert/FixBitVec.hpp')
-rw-r--r--chilbert/FixBitVec.hpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/chilbert/FixBitVec.hpp b/chilbert/FixBitVec.hpp
index bba25d9..0bc2032 100644
--- a/chilbert/FixBitVec.hpp
+++ b/chilbert/FixBitVec.hpp
@@ -25,6 +25,7 @@
#include <climits>
#include <cstddef>
#include <cstdint>
+#include <iostream>
namespace chilbert {
@@ -266,6 +267,15 @@ grayCodeInv(CFixBitVec& value)
grayCodeInv<FBV_UINT>(value.rack());
}
+inline std::ostream&
+operator<<(std::ostream& os, const CFixBitVec& vec)
+{
+ for (size_t i = 0; i < vec.size(); ++i) {
+ os << vec.test(vec.size() - i - 1);
+ }
+ return os;
+}
+
} // namespace chilbert
#endif