fix: use distance instead of hoping for pointers arithmetics
just in case
This commit is contained in:
parent
25dc4b655f
commit
1fdd977408
1 changed files with 1 additions and 1 deletions
|
|
@ -198,7 +198,7 @@ EOT& roulette_wheel(eoPop<EOT>& _pop, double total, eoRng& _gen = rng)
|
||||||
template <class It>
|
template <class It>
|
||||||
It deterministic_tournament(It _begin, It _end, unsigned _t_size, eoRng& _gen = rng)
|
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)
|
for (unsigned i = 0; i < _t_size - 1; ++i)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue