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

@@ -139,12 +139,10 @@ public:
BOOST_CONTRACT_ASSERT(length() < capacity());
}
static void vstack_precondition(int const& count) {
BOOST_CONTRACT_ASSERT(count >= 0);
}
explicit vstack(int count = 10) :
boost::contract::constructor_precondition<vstack>(boost::bind(
&vstack::vstack_precondition, boost::cref(count))),
boost::contract::constructor_precondition<vstack>([&] {
BOOST_CONTRACT_ASSERT(count >= 0);
}),
vect_(count), // OK, executed after precondition so count >= 0.
len_(0)
{