This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/48125] New: max() and min() member functions of random number engines should be static
- From: "john.salmon at deshaw dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 14 Mar 2011 22:00:37 +0000
- Subject: [Bug libstdc++/48125] New: max() and min() member functions of random number engines should be static
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48125
Summary: max() and min() member functions of random number
engines should be static
Product: gcc
Version: 4.5.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: john.salmon@deshaw.com
Table 113 in 26.5.1.3 says that expressions G::min() and G::max() should have
the result type of the class G satisfying the requirements of a uniform random
number generator. The specific engines in 26.5.3 (linear_congruential,
mersenne_twister, etc.) are required to have static constexpr min() and max()
members.
In include/c++/4.5.2/bits/random.h, the min() and max() member functions are
all non-static. I think the fix is simply to add the static keyword and remove
the const qualifier from all of them.