fix: use distance instead of hoping for pointers arithmetics

just in case
This commit is contained in:
Johann Dreo 2020-03-29 17:41:52 +02:00
commit 1fdd977408

View file

@ -198,7 +198,7 @@ EOT& roulette_wheel(eoPop<EOT>& _pop, double total, eoRng& _gen = rng)
template <class It>
It deterministic_tournament(It _begin, It _end, unsigned _t_size, eoRng& _gen = rng)
{
It best = _begin + _gen.random(_end - _begin);
It best = _begin + _gen.random(std::distance(_begin,_end));
for (unsigned i = 0; i < _t_size - 1; ++i)
{