![]() |
Home | Libraries | People | FAQ | More |
boost::CV::constrained_value — A template to specify a constrained basic value type.
// In header: <boost/date_time/constrained_value.hpp> template<typename value_policies> class constrained_value { public: // types typedef ; // construct/copy/destruct (); constrained_value & (); // public member functions () ; // public static functions (); (); // private member functions (); };
This template provides a quick way to generate an integer type with a constrained range. The type provides for the ability to specify the min, max, and and error handling policy.
value policies A class that provides the range limits via the min and max functions as well as a function on_error that determines how errors are handled. A common strategy would be to assert or throw and exception. The on_error is passed both the current value and the new value that is in error.