Skip to content

Commit

Permalink
finished to review extra doc section
Browse files Browse the repository at this point in the history
  • Loading branch information
lcaminiti committed Aug 22, 2019
1 parent 0c14650 commit f3721a7
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 81 deletions.
133 changes: 69 additions & 64 deletions doc/extras.qbk

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions example/features/move.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class circular_buffer :
}

// Move constructor.
/* implicit */ circular_buffer(circular_buffer&& other) :
circular_buffer(circular_buffer&& other) :
boost::contract::constructor_precondition<circular_buffer>([&] {
BOOST_CONTRACT_ASSERT(!other.moved());
})
Expand Down Expand Up @@ -87,7 +87,7 @@ class circular_buffer :
}

// Copy constructor.
/* implicit */ circular_buffer(circular_buffer const& other) :
circular_buffer(circular_buffer const& other) :
boost::contract::constructor_precondition<circular_buffer>([&] {
BOOST_CONTRACT_ASSERT(!other.moved());
})
Expand Down
8 changes: 4 additions & 4 deletions example/features/union.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ union positive {
explicit positive(int x) : d_(0) {
// ...unions cannot have bases so constructor preconditions here.
boost::contract::constructor_precondition<positive> pre([&] {
BOOST_CONTRACT_ASSERT(x >= 0);
BOOST_CONTRACT_ASSERT(x > 0);
});
boost::contract::old_ptr<int> old_instances =
BOOST_CONTRACT_OLDOF(instances());
Expand Down Expand Up @@ -60,7 +60,7 @@ union positive {
void get(int& x) const {
boost::contract::check c = boost::contract::public_function(this)
.postcondition([&] {
BOOST_CONTRACT_ASSERT(x >= 0);
BOOST_CONTRACT_ASSERT(x > 0);
})
;

Expand All @@ -84,7 +84,7 @@ union positive {
explicit positive(double x) : d_(0) {
// Unions cannot have bases so constructor preconditions here.
boost::contract::constructor_precondition<positive> pre([&] {
BOOST_CONTRACT_ASSERT(x >= 0);
BOOST_CONTRACT_ASSERT(x > 0);
});
boost::contract::old_ptr<int> old_instances =
BOOST_CONTRACT_OLDOF(instances());
Expand All @@ -102,7 +102,7 @@ union positive {
void get(double& x) const {
boost::contract::check c = boost::contract::public_function(this)
.postcondition([&] {
BOOST_CONTRACT_ASSERT(x >= 0);
BOOST_CONTRACT_ASSERT(x > 0);
})
;

Expand Down
4 changes: 2 additions & 2 deletions include/boost/contract/core/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -587,8 +587,8 @@ Configure this library compile-time and run-time behaviours.
compilation from production code).
@see @RefSect{tutorial.old_values, Old Values},
@RefSect{advanced.old_value_copies_at_body,
Old Value Copies at Body},
@RefSect{advanced.old_values_copied_at_body,
Old Values Copied at Body},
@RefSect{extras.disable_contract_compilation__macro_interface_,
Disable Contract Compilation}
*/
Expand Down
6 changes: 3 additions & 3 deletions include/boost/contract/core/exception.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ Set a new failure handler and returns it.
concatenating function calls).
@see @RefSect{advanced.throw_on_failures__and__noexcept__, Throw on Failure},
@RefSect{advanced.old_value_copies_at_body, Old Value Copies at Body}
@RefSect{advanced.old_values_copied_at_body, Old Values Copied at Body}
*/
inline from_failure_handler const& set_old_failure(from_failure_handler const&
f) /** @cond */ BOOST_NOEXCEPT_OR_NOTHROW /** @endcond */ {
Expand All @@ -736,7 +736,7 @@ This is often called only internally by this library.
@return A copy of the failure handler currently set.
@see @RefSect{advanced.throw_on_failures__and__noexcept__, Throw on Failure},
@RefSect{advanced.old_value_copies_at_body, Old Value Copies at Body}
@RefSect{advanced.old_values_copied_at_body, Old Values Copied at Body}
*/
inline from_failure_handler get_old_failure()
/** @cond */ BOOST_NOEXCEPT_OR_NOTHROW /** @endcond */ {
Expand All @@ -761,7 +761,7 @@ This is often called only internally by this library.
throw exceptions instead of terminating the program).
@see @RefSect{advanced.throw_on_failures__and__noexcept__, Throw on Failure},
@RefSect{advanced.old_value_copies_at_body, Old Value Copies at Body}
@RefSect{advanced.old_values_copied_at_body, Old Value Copied at Body}
*/
inline void old_failure(from where) /* can throw */ {
#ifndef BOOST_CONTRACT_DISABLE_THREADS
Expand Down
8 changes: 4 additions & 4 deletions include/boost/contract/core/specify.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ This object is internally constructed by this library when users specify
contracts calling @RefFunc{boost::contract::function} and similar functions
(that is why this class does not have a public constructor).
@see @RefSect{advanced.old_value_copies_at_body, Old Value Copies at Body},
@see @RefSect{advanced.old_values_copied_at_body, Old Values Copied at Body},
@RefSect{tutorial.postconditions, Postconditions},
@RefSect{tutorial.exception_guarantees, Exception Guarantees}
Expand Down Expand Up @@ -392,7 +392,7 @@ class specify_old_postcondition_except { // Privately copyable (as *).
It should often be sufficient to initialize old value pointers as soon as
they are declared, without using this function (see
@RefSect{advanced.old_value_copies_at_body, Old Value Copies at Body}).
@RefSect{advanced.old_values_copied_at_body, Old Values Copied at Body}).
@param f Nullary functor called by this library @c f() to assign old
value copies just before the body is executed but after entry
Expand Down Expand Up @@ -510,7 +510,7 @@ contracts calling @RefFunc{boost::contract::function} and similar functions
(that is why this class does not have a public constructor).
@see @RefSect{tutorial.preconditions, Preconditions},
@RefSect{advanced.old_value_copies_at_body, Old Value Copies at Body},
@RefSect{advanced.old_values_copied_at_body, Old Values Copied at Body},
@RefSect{tutorial.postconditions, Postconditions},
@RefSect{tutorial.exception_guarantees, Exception Guarantees}
Expand Down Expand Up @@ -565,7 +565,7 @@ class specify_precondition_old_postcondition_except { // Priv. copyable (as *).
It should often be sufficient to initialize old value pointers as soon as
they are declared, without using this function (see
@RefSect{advanced.old_value_copies_at_body, Old Value Copies at Body}).
@RefSect{advanced.old_values_copied_at_body, Old Values Copied at Body}).
@param f Nullary functor called by this library @c f() to assign old
value copies just before the body is executed but after entry
Expand Down
4 changes: 2 additions & 2 deletions include/boost/contract_macro.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ Disable Contract Compilation}).
@see @RefSect{extras.disable_contract_compilation__macro_interface_,
Disable Contract Compilation},
@RefSect{advanced.old_value_copies_at_body,
Old Value Copies at Body}
@RefSect{advanced.old_values_copied_at_body,
Old Values Copied at Body}
*/
#define BOOST_CONTRACT_OLD(...)

Expand Down

0 comments on commit f3721a7

Please sign in to comment.