From: Neal Becker (ndbecker2_at_[hidden])
Date: 2008-05-20 13:27:45
I have used constrained_value to prototype a fixed-pt class. It seems to be
One thing might be useful is to have the option to record minimum and
maximum values that are used during a given computation.
Right now, I have:
template<int int_bits, int frac_bits, typename base_type=int, typename
struct fixed_pt : ...
static const int total_bits = int_bits + frac_bits;
static const base_type max = ~(base_type(-1) << (total_bits-1));
static const base_type min = (base_type(-1) << (total_bits-1));
typedef typename cv::bounded_int<base_type, min,
So fixed_pt<> contains a bounded_int member.
I'm wondering how to add a facility to track extremal values. It would seem
to be nice to add it into the 'value' member itself, but I suspect this
concept doesn't really fit with the constrained_value design.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk