X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Frand%2FGaloisLFSR.hpp;h=81652d85f54a64cd628c22a95d3493b6de6476cd;hb=f1f8941a3f682fb589cf3c620fc7e7602cfc0f7f;hp=f5de7ad0bb650f15d9d6870d82e3bd6f3ee97b70;hpb=f9a060d3e46fbfb0daefc0623fa217a62e5c8c2b;p=blank.git diff --git a/src/rand/GaloisLFSR.hpp b/src/rand/GaloisLFSR.hpp index f5de7ad..81652d8 100644 --- a/src/rand/GaloisLFSR.hpp +++ b/src/rand/GaloisLFSR.hpp @@ -42,6 +42,11 @@ public: return out = static_cast(state); } + /// special case for randrom(boolean), since static_cast(0b10) == true + bool operator ()(bool &out) noexcept { + return out = operator ()(); + } + template T Next() noexcept { T next;