mirror of
https://github.com/boostorg/contract.git
synced 2026-02-26 16:42:19 +00:00
24 lines
452 B
C++
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;
|
|
};
|
|
|