Template Function Cacao::Check(bool, std::string, std::function<void()>)

Function Documentation

template<typename E>
void Cacao::Check(bool condition, std::string message, std::function<void()> unwindFn = []() {})

Checks if the condition is true, and throws an exception if not.

Parameters:
  • condition – The condition to check.

  • message – The human-readable message to print if the condition is false

  • unwindFn – A function to clean up state before exception throwing should the condition be false (to handle non-RAII-conformant stuff)