boostorg / boostorg/contract

Runtime error.

Open
#40 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
41
Forks
30
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.