I encountered a runtime error:
When I write:
auto check = boost::contract::public_function(this)
.precondition([&]() { BOOST_CONTRACT_ASSERT(is_double() || is_unknown()); });
it throws the error:
"Assertion failed: BOOST_CONTRACT_ERROR_missing_check_object_declaration"
at runtime.
However, when I change it to:
boost::contract::check check = boost::contract::public_function(this)
.precondition([&]() { BOOST_CONTRACT_ASSERT(is_double() || is_unknown()); });
there is no error.
Do I have to write it the second way?
I encountered a runtime error:
When I write:
it throws the error:
"Assertion failed: BOOST_CONTRACT_ERROR_missing_check_object_declaration"
at runtime.
However, when I change it to:
there is no error.
Do I have to write it the second way?