expects - MichaelMiller-/sec21 GitHub Wiki

expects

#include <sec21/expects.h>

A simple one-liner that provides general error handling. If the condition evaluates to false, a centrally defined action is executed with the passed text.

// if the condition is false a std::runtime_error is thrown
expects([=]{ return value > 23; }, "value has to be greater than 23");
⚠️ **GitHub.com Fallback** ⚠️