Boost logo

Boost :

From: Daryle Walker (darylew_at_[hidden])
Date: 2001-10-31 17:42:33


on 10/31/01 10:23 AM, Bill Seymour at bill-at-the-office_at_[hidden] wrote:

> Last weekend in Redmond, Beman told me that one objection to the fixed-point
> decimal library was that I hadn't used operators.hpp. I said that I had
> looked at it once and my first impression was that it offered more pain than
> gain; but I promised to look at it again.
>
> OK, I'm trying to apply this to the decimal<> class; and so far I've written:
>
> template<int Precision = 0>
> class decimal
> : unit_steppable< decimal<Precision>
> , arithmetic2< decimal<Precision>, int
> , arithmetic2< decimal<Precision>, decimal<?>
> , arithmetic2< decimal<Precision>, rounding_proxy< decimal<?> >
> > > > >
>
> Note the two occurrances of decimal<?>. I don't understand how to say
> "decimal<some other precision>" here. What am I missing?

I don't think you can. Those second parameters only take a single type, not
a family of types. You have to do relations between other decimal types or
rounding proxies manually with member and function templates.

-- 
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com

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