Subject: [Boost-bugs] [Boost C++ Libraries] #6495: consider implementing traits for numeric types in terms of numeric_limits
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-01-30 17:40:30
#6495: consider implementing traits for numeric types in terms of numeric_limits
-----------------------------------------------------------+----------------
Reporter: ramey | Owner: johnmaddock
Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: type_traits
Version: Boost 1.48.0 | Severity: Problem
Keywords: is_signed, is_unsigned, is_float, is_integral |
-----------------------------------------------------------+----------------
The following type traits
is_signed, is_unsigned, is_float, is_integral, are currently implemented
by checking against a list of numeric primitives. so far so good.
But what happens when one specializes numeric_limits for his own new
wizbang numeric type like big_integer, arbitrary_length integer,
modular_integer, safe_integer, safe_float, etc. etc. I ideally I would
expect to see that the above type traits should "just work" but they won't
under the current implementation.
Note that specializing std::numeric_limits is permited by the current
standard for one's own types (though not for types in the std namespace)
so this is an actual problem rather than a hypothetical one.
The would leave make_signed, make_unsigned a little bit out in the cold as
they're implementation can't be done in terms of std::numeric_limits.
admittedly, is_integral might not fit here as it has a very specific
meaning, but I think my concern applies to the other ones for regardless.
Robert Ramey
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/6495> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:08 UTC