Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<random>: uniform_*_distribution Not Satisfy RandomNumberDistribution Named Requirements #4679

Closed
c0nstexpr opened this issue May 17, 2024 · 1 comment

Comments

@c0nstexpr
Copy link

Describe the bug

uniform_int_distribution::param() member is inherited from uniform_int.

_NODISCARD param_type param() const noexcept /* strengthened */ {

Thus the return type is uniform_int::param_type not uniform_int_distribution::param_type, which conflicts RandomNumberDistribution.

@frederick-vs-ja
Copy link
Contributor

The correct param function is now here, which is not inherited from uniform_int.

STL/stl/inc/random

Lines 2264 to 2266 in 8dc4faa

_NODISCARD param_type param() const noexcept /* strengthened */ {
return _Mybase::param();
}

Same for uniform_real_distribution.

STL/stl/inc/random

Lines 3155 to 3157 in 8dc4faa

_NODISCARD param_type param() const noexcept /* strengthened */ {
return _Mybase::param();
}

The issue was existing before but fixed in #4284. You can use VS 2022 17.10 to check the status.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants