
19 Sep
2011
19 Sep
'11
5:58 p.m.
2011/9/19 lcaminiti <lorcaminiti@gmail.com>
CONTRACT_FUNCTION_TPL( public void (push_back) ( (const T&) value ) precondition( size() < max_size(), ) postcondition( auto old_size = CONTRACT_OLDOF size(), auto old_capacity = CONTRACT_OLDOF capacity(), back() == value, // (1) size() == old_size + 1, capacity() >= old_capacity, ) ) ; };
Why not use SFINAE expressions to disable post conditions that aren't well-formed? SFINAE expressions feature is required by the C++11 and is available in several C++03 implementations including gcc and MSVC. Roman Perepelitsa.