Subject: Re: [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 19:17:01
#6495: consider implementing traits for numeric types in terms of numeric_limits
-------------------------------+--------------------------------------------
Reporter: ramey | Owner: johnmaddock
Type: Feature Requests | Status: closed
Milestone: To Be Determined | Component: type_traits
Version: Boost 1.48.0 | Severity: Problem
Resolution: invalid | Keywords: is_signed, is_unsigned, is_float, is_integral
-------------------------------+--------------------------------------------
Changes (by johnmaddock):
* status: new => closed
* resolution: => invalid
Comment:
Nope sorry, the whole raison d'etre of type traits is to inspect the
properties of a *type*. is_integer etc will only ever be specialized for
built-in types, because "big_integer" is *not* an integer, it's class
type. This whole topic has been thrashed out several times (not least
when type traits were first proposed), and isn't going to change now.
Besides you can get the information you require from numeric_limits
directly:
is_integer == true
All integer types.
is_bounded == true
has min and max values
is_signed == true
signed integer otherwise unsigned
is_integer == is_exact == false
floating point type
Regards, John.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/6495#comment:1> 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