
Robert Kawulak wrote:
Hi all,
I've updated the Boost Constrained Value library (which is likely to be reviewed soon) -- the list of changes is below: - added unconstrained -- a new constrained alias to replace it in release mode if constraint-checking is not needed and efficiency is a concern, - added Examples section to the documentation, - other minor corrections and improvements in the documentation, - using BOOST_THROW_EXCEPTION instead of boost::throw_exception() (requires Boost version 1.37.0), - fixed one place to make a better use of EBO.
As usually, the code and documentation can be downloaded here: http://rk.go.pl/f/constrained_value.zip The documentation is also available online here: http://rk.go.pl/r/constrained_value
Thanks. I thought to use 'unconstrained', but this isn't really what I need. I have a fixed_pt integer class, //! signed fixed pt template<int int_bits, int frac_bits, typename base_type=int, typename error_policy=cv::throw_exception<>, typename round_policy=rnd<base_type> > struct fixed_pt : ... typedef typename cv::bounded_int<base_type, min, max,error_policy>::type val_t; When I want to turn off checking, it seems the thing to do is use an error_policy which ignores the error. I've been using this, which I got from you some time ago: struct no_error_policy { template <typename V, class C> void operator () (V & old_val, const V & new_val, C &) { old_val = new_val; } }; So I can write: fixed_pt<16,5,int,cv::no_error_policy> f; Maybe this is a useful addition to the lib, or at least as an example?