boostorg / random

Boost.org random module
http://boost.org/libs/random
35 stars 69 forks source link

type/value mismatch in discrete_distribution.hpp #72

Open ForceFaction opened 4 years ago

ForceFaction commented 4 years ago

This condition leads to

/usr/include/boost/random/discrete_distribution.hpp:603:32: error: type/value mismatch at argument 1 in template parameter list for ‘template<class First, class ... Others> using first = First’
  603 |             if(a_iter->first < normalized_average) {
      |                                ^~~~~~~~~~~~~~~~~~
/usr/include/boost/random/discrete_distribution.hpp:603:32: note:   expected a type, got ‘normalized_average’

Substituting with std::less(a_iter->first, normalized_average) fixes this issue.