| Home | Libraries | People | FAQ | More

## Macro BOOST_CONTRACT_OLDOF

BOOST_CONTRACT_OLDOF — Macro typically used to copy an old value expression and assign it to an old value pointer.

## Synopsis

    // In header: <boost/contract/old.hpp>

    BOOST_CONTRACT_OLDOF(...)

## Description

The expression expanded by this macro should be assigned to an old value pointer of type `boost::contract::old_ptr` or `boost::contract::old_ptr_if_copyable`. This is an overloaded variadic macro and it can be used in the following different ways.

1. From within virtual public functions and public functions overrides:

    BOOST_CONTRACT_OLDOF(v, old_expr)

2. From all other operations:

    BOOST_CONTRACT_OLDOF(old_expr)

Where:

- `v` is the extra parameter of type `boost::contract::virtual_``*` and default value `0` from the enclosing virtual public function or public function overrides declaring the contract.

- `old_expr` is the expression to be evaluated and copied into the old value pointer. (This is not a variadic macro parameter so any comma it might contain must be protected by round parenthesis and `BOOST_CONTRACT_OLDOF(v, (old_expr))` will always work.)

On compilers that do not support variadic macros, programmers can manually copy old value expressions without using this macro (see No Macros).

See Also: Old Values