This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/48125] New: max() and min() member functions of random number engines should be static


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]