Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::CV::constrained_value< value_policies > Class Template Reference

A template to specify a constrained basic value type. More...

#include <constrained_value.hpp>

Inheritance diagram for boost::CV::constrained_value< value_policies >:

Public Types

typedef value_policies::value_type value_type
 

Public Member Functions

 constrained_value (value_type value)
 
constrained_valueoperator= (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_
 

Detailed Description

template<class value_policies>
class boost::CV::constrained_value< value_policies >

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.

Member Typedef Documentation

template<class value_policies >
typedef value_policies::value_type boost::CV::constrained_value< value_policies >::value_type

Constructor & Destructor Documentation

template<class value_policies >
boost::CV::constrained_value< value_policies >::constrained_value ( value_type  value)
inline

Member Function Documentation

template<class value_policies >
static value_type max boost::CV::constrained_value< value_policies >::BOOST_PREVENT_MACRO_SUBSTITUTION ( )
inlinestatic

Return the max allowed value (traits method)

References boost::accumulators::extract::max.

template<class value_policies >
static value_type min boost::CV::constrained_value< value_policies >::BOOST_PREVENT_MACRO_SUBSTITUTION ( )
inlinestatic

Return the min allowed value (traits method)

References boost::accumulators::extract::min.

template<class value_policies >
boost::CV::constrained_value< value_policies >::operator value_type ( ) const
inline

Coerce into the representation type.

References boost::CV::constrained_value< value_policies >::value_.

template<class value_policies >
constrained_value& boost::CV::constrained_value< value_policies >::operator= ( value_type  v)
inline

Member Data Documentation


The documentation for this class was generated from the following file: