Skip to main content

2 docs tagged with "preconditions"

View all tags

Assertions and static_assert

Assertions are runtime or compile-time checks that verify program invariants and assumptions. They help catch bugs early during development and document expected conditions in code.

Contracts (C++20)

Contracts are a programming paradigm that formally specifies the obligations and guarantees of code. They consist of preconditions (what callers must ensure), postconditions (what functions guarantee), and invariants (what must always be true).