Template Function Aux::enforce(bool, const std::string&)

Function Documentation

template<typename Exception = std::runtime_error>
inline void Aux::enforce(bool b, const std::string &msg)

Enforces that b is true and throws an Exception otherwise.

If provided, msg must not be null, otherwise the behavior of this function is undefined.

Parameters:
  • b – Boolean value whose truthiness should be enforced

  • msg – Message of the exception