|
Boost : |
From: Bill Seymour (bill-at-the-office_at_[hidden])
Date: 2002-11-05 09:36:44
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.
--Bill
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk