This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/78975] New: uniform_real_distribution should not check RealType with is_floating_point
- From: "charles at karney dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 03 Jan 2017 13:17:07 +0000
- Subject: [Bug libstdc++/78975] New: uniform_real_distribution should not check RealType with is_floating_point
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78975
Bug ID: 78975
Summary: uniform_real_distribution should not check RealType
with is_floating_point
Product: gcc
Version: 6.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: charles at karney dot com
Target Milestone: ---
random's uniform_real_distribution checks the its template argument with
is_floating_point. This means it can't be used with high-precision
types such as boost::multiprecision::float128. See
https://svn.boost.org/trac/boost/ticket/12720
John Maddock (the maintainer of the boost multiprecision libraries) says
that, because float128 qualifies as is_class it's not possible for it
also to be is_float_point. On the other hand, numeric_limits can (and
is) specialized for float128. So I'd like to request that the tests in
uniform_real_distribution and other real distributions be changed from
static_assert(std::is_floating_point<_RealType>::value,
"template argument not a floating point type");
to something like
static_assert(std::numeric_limits<_RealType>::is_specialised &&
!std::numeric_limits<_RealType>::is_integer,
"template argument not a floating point type");
Thanks!