Boost logo

Boost :

Subject: Re: [boost] [XInt] Review
From: Joachim Faulhaber (afojgo_at_[hidden])
Date: 2011-03-09 14:48:39


2011/3/9 Jeffrey Lee Hellrung, Jr. <jhellrung_at_[hidden]>:
> On 3/9/2011 11:14 AM, Steven Watanabe wrote:
>>
>> AMDG
>>
>> On 03/09/2011 10:11 AM, Joachim Faulhaber wrote:
>>>
>>> 3.2.3 Specialization of boost::is_integral<T>
>>> =============================================
>>>
>>> You'd have to provide an instantiation of boost type trait
>>> boost::is_integral for xint::integral_t, so meta code that is
>>> implemented for all intergal types will be able to work with xint
>>> instantly.
>>
>> I disagree. xint::integer_t is not an integral type
>> as defined by the standard. [basic.fundamental]
>
> +1

that depends ... I am not aware, that boost::is_integral is limited to
fundamental types. Maybe there is a degree of freedom for
interpretation here, I may be wrong. Anyway, from the perspective of
my library I need to identify general type traits, e.g. if a type has
a least steppable unit that makes it discrete.

As a sufficient condition I can use boost::is_integral<T> on built in types.

>
> One would need an alternate metafunction for such purposes.
> std::numeric_limits<T>::is_specialized && std::numeric_limits<T>::is_integer
> ?

I wouldn't connect this with numeric_limits
(1) bigint is typically limitless ;-)
(2) std::numeric_limits couples different metafunctions (depreciated
design) that should better be independent.

-- 
Interval Container Library [Boost.Icl]
http://www.joachim-faulhaber.de

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk