|
Boost : |
From: Christoph Ludwig (cludwig_at_[hidden])
Date: 2004-05-16 11:21:34
On Sun, May 16, 2004 at 11:07:22AM -0400, christopher diggins wrote:
> From: "Jeff Garland" <jeff_at_[hidden]>
> > On Sat, 15 May 2004 22:37:43 -0400, christopher diggins wrote
> > > // you can explicitly turn off range_checking
> > > #ifdef BOOST_RANGE_CHECKING_OFF
> > > #define BOOST_RANGE_CHECKING_ON 0
> > > #else
> > > #define BOOST_RANGE_CHECKING_ON 1
> > > #endif
> >
> > Again what happens if I want to change it for some, but not all my
> constrained
> > types.
>
> On this point, I am not convinced that it is important to make this
> specifically a policy. I can only imagine the usage of this kind of switch
> for debug versus release code. Switching on a BOOST_RANGE_CHECKING policy
> for only some types strikes me as rather pathological.
You may be right if all the range checking policy can do is
signaling an error - I am not sure. But I can imagine applications
where you'd like a saturating range checking policy, i.e. the input
value is replaced by the maximum or minimum valid value. Or you need a
periodic behaviour where the input value is projected onto an
interval.
OTOH, I may be falling into the trap of over-engineering.
Regards
Christoph
-- http://www.informatik.tu-darmstadt.de/TI/Mitarbeiter/cludwig.html LiDIA: http://www.informatik.tu-darmstadt.de/TI/LiDIA/Welcome.html
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk