]> git.localhorst.tv Git - blank.git/blobdiff - src/rand/GaloisLFSR.hpp
test random ints of various widths
[blank.git] / src / rand / GaloisLFSR.hpp
index f5de7ad0bb650f15d9d6870d82e3bd6f3ee97b70..81652d85f54a64cd628c22a95d3493b6de6476cd 100644 (file)
@@ -42,6 +42,11 @@ public:
                return out = static_cast<T>(state);
        }
 
+       /// special case for randrom(boolean), since static_cast<bool>(0b10) == true
+       bool operator ()(bool &out) noexcept {
+               return out = operator ()();
+       }
+
        template<class T>
        T Next() noexcept {
                T next;