Boost logo

Boost :

From: Hervé Brönnimann (hervebronnimann_at_[hidden])
Date: 2008-06-07 21:37:58


I am not following this thread but when I hear of things like
boost::numeric::interval<void *>, I have to wonder: what is it you
are trying to do? Interval is a *numeric* type, intended for
*computation* (i.e., operator+,-,*,/). It is not really intended for
integral types, and certainly not for pointer types. If you want an
interval of void*, maybe you should consider std::complex<void*>
(just kidding, but you can actually see the parallel), or more likely
std::pair<void*>.

--
Hervé Brönnimann
hervebronnimann_at_[hidden]
On Jun 6, 2008, at 4:14 AM, Phil Bouchard wrote:
>
> "Simonson, Lucanus J" <lucanus.j.simonson_at_[hidden]> wrote in message
> news: 
> 33E1C72C74DBE747B7B59C1740F7443703593075_at_orsmsx417.amr.corp.intel.com. 
> ..
>
> [...]
>
>> I forgot to mention that casting the pointer to signed integer will
>> cause problems even if they happen to be the same bit width.  This is
>> because pointer values with a 1 in the msb will cast to negative  
>> integer
>> values, which will cause the order of p and p+s to become inverted,
>> leading to an error condition in numeric::interval, which will  
>> result in
>> a null interval, according to interval's documentation.  That  
>> would be
>> difficult to debug.
>
> Like previously mentionned that cast is simply a temporary solution  
> but
> hopefully void * types will be easy to integrate into interval<>.   
> I will
> also change int for unsigned until void * works.
>
>
> -Phil
>
>
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/ 
> listinfo.cgi/boost

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