Skip to content

Runtime error. #40

@fynkxo

Description

@fynkxo

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions