A template to specify a constrained basic value type. More...
#include <constrained_value.hpp>
Public Types | |
typedef value_policies::value_type | value_type |
Public Member Functions | |
constrained_value (value_type value) | |
constrained_value & | operator= (value_type v) |
operator value_type () const | |
Coerce into the representation type. More... | |
Static Public Member Functions | |
static value_type max | BOOST_PREVENT_MACRO_SUBSTITUTION () |
Return the max allowed value (traits method) More... | |
static value_type min | BOOST_PREVENT_MACRO_SUBSTITUTION () |
Return the min allowed value (traits method) More... | |
Protected Attributes | |
value_type | value_ |
A template to specify a constrained basic value type.
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.
typedef value_policies::value_type boost::CV::constrained_value< value_policies >::value_type |
|
inline |
|
inlinestatic |
Return the max allowed value (traits method)
References boost::accumulators::extract::max.
|
inlinestatic |
Return the min allowed value (traits method)
References boost::accumulators::extract::min.
|
inline |
Coerce into the representation type.
References boost::CV::constrained_value< value_policies >::value_.
|
inline |
|
protected |