|
Boost : |
From: Fernando Cacciola (fcacciola_at_[hidden])
Date: 2001-08-24 15:19:25
----- Original Message -----
From: <scleary_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Friday, August 24, 2001 5:02 PM
Subject: RE: [boost] Seminumerical algorithms, was Re: Unlimited integer:
conversion to built-in int?
> > > > Would there be some need for seminumerical functions?
> > > > Would this solution be better than
> > > > an implicit conversion to bool for unlimited integer?
> > >
> > > I think it's a better solution. I also think there's a place for
> > > numeric/integer traits which would support generic numeric/integer
> > > algorithms.
> > >
> >
> > Can yo be a bit more specific what kind of traits you
> > are thinking of?
>
> I don't mean just type properties (e.g., is_bounded/is_signed), but also
> type methods (int_traits is a namespace):
> int_traits::is_zero(x) -- returns true if x == 0
> int_traits::is_positive(x) -- returns true if x >= 0
> int_traits::is_odd(x) -- returns true if (x % 2) == 1
>
These predicates are not integer specific but number specific.
If something like this is done it should be applicable to any numeric type.
Fernando Cacciola
Sierra s.r.l.
fcacciola_at_[hidden]
www.gosierra.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk