First of all, there is a need to define a custom assertion failure report class which inherits from comms::Assert and overrides pure virtual member function fail():
{
public:
MyAssert(...) {...}
protected:
const char* expr,
const char* file,
unsigned int line,
const char* function) override
{
...
}
private:
...
}
Base class for any custom assertion behaviour.
Definition Assert.h:27
virtual void fail(const char *expr, const char *file, unsigned int line, const char *function)=0
Pure virtual function to be called when assertion fails.
Aggregates all the includes of the COMMS library interface.
The second stage is to enable/register the the custom assertion failure behaviour:
int main(int argc, const char* argv[])
{
...
}
Enable new assertion behaviour.
Definition Assert.h:100
It is also possible to override custom assertion failure behavior several times:
int main(int argc, const char* argv[])
{
...
{
...
}
...
}