Template Function Aux::enforce(bool, std::string_view)

Function Documentation

template<typename Exception = std::runtime_error>
inline void Aux::enforce(bool b, std::string_view 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