Imported Upstream version 1.72.0
[platform/upstream/boost.git] / libs / contract / example / features / loop.cpp
index 1fa2dd9..1d8acdd 100644 (file)
@@ -23,7 +23,7 @@ int main() {
         boost::contract::check c = boost::contract::function()
             .precondition([&] {
                 BOOST_CONTRACT_ASSERT(
-                        total + *i <= std::numeric_limits<int>::max());
+                        total < std::numeric_limits<int>::max() - *i);
             })
             .postcondition([&] {
                 BOOST_CONTRACT_ASSERT(total == *old_total + *i);