![]() |
Home | Libraries | People | FAQ | More |
boost::contract::old_value — Convert user-specified expressions to old values.
// In header: <boost/contract/old.hpp> class old_value { public: // construct/copy/destruct template<typename T> old_value(T const &, typename boost::enable_if< boost::contract::is_old_value_copyable< T > >::type * = 0); template<typename T> old_value(T const &, typename boost::disable_if< boost::contract::is_old_value_copyable< T > >::type * = 0); };
This class is usually only implicitly used by this library and it does not explicitly appear in user code.
On older compilers that cannot correctly deduce the boost::contract::is_old_value_copyable
trait used in the declaration of this class, programmers can manually specialize that trait to make sure that only old value types that are copyable are actually copied.
See Also:
old_value
public
construct/copy/destructtemplate<typename T> old_value(T const & old, typename boost::enable_if< boost::contract::is_old_value_copyable< T > >::type * = 0);Construct this object from the specified old value when the old value type is copy constructible.
The specified old value old
is copied (one time only) using
, in which case the related old value pointer will not be null (but no copy is made if postconditions and exception guarantees are not being checked, see boost::contract::old_value_copy
).BOOST_CONTRACT_NO_OLDS
Parameters: |
|
||
Template Parameters: |
|
template<typename T> old_value(T const & old, typename boost::disable_if< boost::contract::is_old_value_copyable< T > >::type * = 0);Construct this object from the specified old value when the old value type is not copyable.
The specified old value old
cannot be copied in this case so it is not copied and the related old value pointer will always be null (thus calls to this constructor have no effect and they will likely be optimized away by most compilers).
Parameters: |
|
||
Template Parameters: |
|