Files
contract/test/invariant/mutable.hpp
2016-03-06 08:56:42 -08:00

24 lines
452 B
C++

// no #include guard
// Test error if non-static inv declared mutable (unless PERMISSIVE #defined).
#include <boost/contract/public_function.hpp>
#include <boost/contract/guard.hpp>
struct a {
void invariant() {}
void f() {
// Same for ctor and dtor (because they all use check_pre_post_inv).
boost::contract::guard c = boost::contract::public_function(this);
}
};
int main() {
a aa;
aa.f();
return 0;
};