added const volatile invariants

This commit is contained in:
Lorenzo Caminiti
2015-11-11 07:47:36 -08:00
parent 72eb227bcf
commit 8e9d7474f1
63 changed files with 1362 additions and 192 deletions

View File

@@ -23,14 +23,15 @@ struct t
typedef BOOST_CONTRACT_BASE_TYPES(BASES) base_types;
#undef BASES
void invariant() const {
out << Id << "::inv" << std::endl;
BOOST_CONTRACT_ASSERT(k_ < 0);
}
static void static_invariant() {
out << Id << "::static_inv" << std::endl;
BOOST_CONTRACT_ASSERT(l.value >= 0);
}
void invariant() const {
out << Id << "::inv" << std::endl;
BOOST_CONTRACT_ASSERT(k_ < 0);
}
struct l_tag;
typedef boost::contract::aux::test::counter<l_tag, int> l_type;
@@ -84,15 +85,16 @@ struct c
typedef BOOST_CONTRACT_BASE_TYPES(BASES) base_types;
#undef BASES
void invariant() const {
out << "c::inv" << std::endl;
BOOST_CONTRACT_ASSERT(j_ < 0);
}
static void static_invariant() {
out << "c::static_inv" << std::endl;
BOOST_CONTRACT_ASSERT(m.value >= 0);
}
void invariant() const {
out << "c::inv" << std::endl;
BOOST_CONTRACT_ASSERT(j_ < 0);
}
struct m_tag;
typedef boost::contract::aux::test::counter<m_tag, int> m_type;
static m_type m;
@@ -143,8 +145,8 @@ struct b
typedef BOOST_CONTRACT_BASE_TYPES(BASES) base_types;
#undef BASES
void invariant() const { out << "b::inv" << std::endl; }
static void static_invariant() { out << "b::static_inv" << std::endl; }
void invariant() const { out << "b::inv" << std::endl; }
explicit b() {} // No contract.
virtual ~b() {}
@@ -159,15 +161,16 @@ struct a
typedef BOOST_CONTRACT_BASE_TYPES(BASES) base_types;
#undef BASES
void invariant() const {
out << "a::inv" << std::endl;
BOOST_CONTRACT_ASSERT(i_ < 0);
}
static void static_invariant() {
out << "a::static_inv" << std::endl;
BOOST_CONTRACT_ASSERT(n.value >= 0);
}
void invariant() const {
out << "a::inv" << std::endl;
BOOST_CONTRACT_ASSERT(i_ < 0);
}
struct n_tag;
typedef boost::contract::aux::test::counter<n_tag, int> n_type;
static n_type n;