...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
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 often 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, 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 is copied (one time only) using
, in which case related old value pointer will not be null (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 cannot be copied in this case so it is not copied and the related old value pointer will always be null (thus a call to this constructor has no effect and it will likely be optimized away by most compilers).
Parameters: |
|
||
Template Parameters: |
|