Skip to content

API · fair::mq::tools

CallOnDestructionclass

#include <Exceptions.h>fairmq/tools/Exceptions.h:29GitHub ↗

Executes the given callback in the destructor. Can be used to execute something in case of an exception when catch is undesirable, e.g.:

{ // callback will be executed only if f throws an exception CallOnDestruction cod([](){ cout << "exception was thrown"; }, true); f(); cod.disable(); }

Functions