
9 Jul
2008
9 Jul
'08
8:12 p.m.
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