X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Frand%2FGaloisLFSR.hpp;h=f8a61e23f3f7c721689d7e0ff4a2404aa671f412;hb=fab49d91255ef7d265817213c3da7e5f81df97a0;hp=81652d85f54a64cd628c22a95d3493b6de6476cd;hpb=f1f8941a3f682fb589cf3c620fc7e7602cfc0f7f;p=blank.git diff --git a/src/rand/GaloisLFSR.hpp b/src/rand/GaloisLFSR.hpp index 81652d8..f8a61e2 100644 --- a/src/rand/GaloisLFSR.hpp +++ b/src/rand/GaloisLFSR.hpp @@ -1,6 +1,7 @@ #ifndef BLANK_RAND_GALOISLFSR_HPP_ #define BLANK_RAND_GALOISLFSR_HPP_ +#include #include #include @@ -63,10 +64,12 @@ public: template typename Container::reference From(Container &c) { + assert(c.size() > 0); return c[Next() % c.size()]; } template typename Container::const_reference From(const Container &c) { + assert(c.size() > 0); return c[Next() % c.size()]; }