Namespaces
Variants
Actions

Talk:cpp/numeric/random/uniform real distribution/operator()

From cppreference.com

[edit] Why is operator() not const?

Why that? The boost analogon has a const operator(): https://www.boost.org/doc/libs/1_72_0/doc/html/boost/random/uniform_real_distribution.html --Roker (talk) 04:29, 17 December 2019 (PST)

None of the random number distribution class templates in the standard have a const operator(), as far as I can tell.
Perhaps it was to avoid constraining implementations from using some internal state they need to change? (Boost doesn't have such an issue, since it's a specific implementation)
You'd have to find the original proposal paper for them to see if there was rationale given.
Hadriel (talk) 06:32, 17 December 2019 (PST)