ppforest2 v0.1.0
Projection Pursuit Decision Trees and Random Forests
Loading...
Searching...
No Matches
Invariant.hpp File Reference
#include <string>
#include <sstream>

Go to the source code of this file.

Functions

void invariant (bool condition, char const *message)
 Runtime assertion that throws on failure.
 
void invariant (bool condition, std::string const &message)
 Runtime assertion that throws on failure.
 

Function Documentation

◆ invariant() [1/2]

void invariant ( bool condition,
char const * message )

Runtime assertion that throws on failure.

If condition is false, throws a std::runtime_error with the given message. Unlike assert(), these checks remain active in release builds.

Parameters
conditionCondition that must hold.
messageError message if the condition fails.

◆ invariant() [2/2]

void invariant ( bool condition,
std::string const & message )

Runtime assertion that throws on failure.

If condition is false, throws a std::runtime_error with the given message. Unlike assert(), these checks remain active in release builds.

Parameters
conditionCondition that must hold.
messageError message if the condition fails.