Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2002-11-05 20:53:03


At 09:36 AM 11/5/2002, Bill Seymour wrote:

>Mattias Flodin wrote:
>>
>> namespace detail {
>> struct round_down_tag {};
>> struct round_up_tag {};
>> }
>> namespace {
>> const detail::round_down_tag round_down;
>> const detail::round_up_tag round_up;
>> }
>>
>> We can now make two separate overloads of operator[]
>> that hold different return types:
>>
>> detail::round_down_proxy operator[](detail::round_down_tag);
>> detail::round_up_proxy operator[](detail::round_up_tag);
>>
>
>I wanted to make the rounding mode extensible so that we
>could have user-defined rounding modes. It seems like
>we'd lose that if we needed an operator[]() member for
>each rounding mode.

If I remember the original discussions correctly, it turns out that
business applications use a variety of rounding rules. Because of legal and
other pressures, they really have to use certain rules. Thus user-defined
rules ensure accomodation.

Bill, please correct me if that isn't right.

--Beman


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