Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2006-06-01 15:46:58

Topher Cooper <topher_at_[hidden]> writes:

> I don't think anyone really objects to unsigned_integer, though some
> question its utility.

I do object. IMO it adds complexity for little or no benefit, and
complexity is a big problem. Also, in my opinion, the job of limiting
the allowed range of values for a type should be provided by a wrapper
template, so that other types can benefit. For example:

  typedef range_checked<
    , non_negative // a predicate
> infinite_precision_unsigned_integer;

  typedef range_checked<
    , abs_less_or_equal_to_1
> result_of_sin_or_cos;

Dave Abrahams
Boost Consulting

Boost list run by bdawes at, gregod at, cpdaniel at, john at