added setters so pre/post cannot be set twice, ctors and dtors only allow to set post, etc.

This commit is contained in:
Lorenzo Caminiti
2015-04-21 23:56:37 -07:00
parent 070efff47e
commit cbd9bae6b9
26 changed files with 281 additions and 141 deletions

View File

@@ -1,6 +1,7 @@
#include "aux_/oteststream.hpp"
#include <boost/contract/free_function.hpp>
#include <boost/contract/type.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <sstream>
@@ -10,10 +11,10 @@ boost::contract::aux::test::oteststream out;
void f() {
boost::contract::type c = boost::contract::free_function()
.precondition([&] () {
.precondition([&] {
out << "f::pre" << std::endl;
})
.postcondition([&] () {
.postcondition([&] {
out << "f::post" << std::endl;
})
;