https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121919

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
N.B. the uniform random bit generator requirements extend the concept by
requiring result_type (and require that that type is not bool, which isn't
required by the concept).

std::uniform_int_distribution meets the requirements of a random number
distribution, and those requirements are only defined in terms of types which
meet the uniform random bit generator requirements. So
std::uniform_int_distribution is allowed to assume a URBG provides result_type.
Which means that ranges algos can't use std::uniform_int_distribution, unless
they wrap a generator in an adaptor that adds result_type (and ensures that the
return type of g() is not bool).

That seems like a defect.

Reply via email to