added .except(...), renamed old_ptr_noncopyable to old_ptr_if_copyable, and renamed OLDOF to OLD

This commit is contained in:
Lorenzo Caminiti
2016-08-21 09:54:10 -07:00
parent a2ac52ffd7
commit ff02b449dd
163 changed files with 1808 additions and 1491 deletions

View File

@@ -8,7 +8,7 @@
#include "../detail/oteststream.hpp"
#include <boost/contract/function.hpp>
#include <boost/contract/guard.hpp>
#include <boost/contract/check.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <sstream>
@@ -17,13 +17,13 @@ boost::contract::test::detail::oteststream out;
struct err {};
void f() {
boost::contract::guard c = boost::contract::function()
.precondition([&] { out << "f::pre" << std::endl; })
.old([&] {
boost::contract::check c = boost::contract::function()
.precondition([] { out << "f::pre" << std::endl; })
.old([] {
out << "f::old" << std::endl;
throw err(); // Test .old() throws.
})
.postcondition([&] { out << "f::post" << std::endl; })
.postcondition([] { out << "f::post" << std::endl; })
;
out << "f::body" << std::endl;
}