|
Boost : |
From: Robert Kawulak (kawulak_at_[hidden])
Date: 2008-07-09 16:12:26
Hi,
> From: utku
>
> can we create a saturating int with only lower bound set and
> upper bound is infinite, like
>
> saturating_int<int, 1>::type ImageBoundary;
Yes, you can simply write:
saturating_int<int, 1, boost::integer_traits<int>::const_max>::type
ImageBoundary;
Since no int is greater than const_max, the upper bound will never be used for
saturation (and I bet compilers will easily optimise the code eliminating the
comparison with the upper bound).
Best regards,
Robert
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk