From: John Max Skaller (skaller_at_[hidden])
Date: 2001-05-19 19:13:28
Bill Seymour wrote:
> I've been thinking about some of the points that Skaller
> and others brought up. How's this?
> - I agree that functions such as abs() should be friends,
> not members. I'm concerned, though, that some compilers
> can't handle template friends.
I suppose it depends on the target audience.
If the class is intended for ISO Standardisation, the faults
of compilers not supporting the Standard should be disregarded:
the committee won't listen to such an argument.
> - I see Skaller's point about the two-argument ctor being
> confusing. At first I thought about suggesting to users
> that they think of the comma as a decimal point; but then
> I caught myself writing an octal constant. 8-) I think
> I've found a use for this ctor, though:
> numeric_limits< decimal<Scale> >::epsilon();
> returns decimal<Scale>(0, 1). I suggest making this ctor
> one of the "public implementation details" mentioned above.
This suggests retaining the constructor, but making
it private, since the use seems limited <g>.
> - I still think that users ought to be able to mix decimals
> of different scale factors in expressions.
I cannot say this is wrong. However, I have USED systems
that did that, mainly PL/1, and figuring out what is happening
is very hard.
I suggest you implement mixed scale arithmetic
and try to use it to see what I mean.
> I suggest that
> the result type always be the type of the left-hand argument.
That is not symmetric. People expect symmetric
operators like addition to be symmetric:
a + b == b + a
-- John (Max) Skaller, mailto:skaller_at_[hidden] 10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850 checkout Vyper http://Vyper.sourceforge.net download Interscript http://Interscript.sourceforge.net
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk