int z;
bool is_prime(int k);
void f(int x)
[[expects: x > 0]]
[[expects audit: is_prime(x)]]
[[ensures: z > 10]]
{
/* ... */
}
— end examplevoid f(int x) noexcept [[expects: x > 0]]; void g() { f(0); // std::terminate() if violation handler throws /* ... */ }— end example
void f(int x) [[expects: x > 0]]; void g() { f(0); // std::terminate() after handler if continuation mode is off; // proceeds after handler if continuation mode is on /* ... */ }— end example