Files
contract/test/invariant/static_mutable.hpp
2016-03-08 07:46:18 -08:00

24 lines
455 B
C++

// no #include guard
// Test error if static inv declared mutable (unless PERMISSIVE #defined).
#include <boost/contract/public_function.hpp>
#include <boost/contract/guard.hpp>
struct a {
void static_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;
};