mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 00:31:14 +00:00
feat: Add new assertm macro
This allows to add a message to the assertion which can improve readability of error diagnostics.
This commit is contained in:
parent
b8503bfbd5
commit
8796ce5b20
|
@ -9,10 +9,15 @@
|
|||
#ifndef FAIR_MQ_ERROR_H
|
||||
#define FAIR_MQ_ERROR_H
|
||||
|
||||
#include <cassert>
|
||||
#include <fairmq/tools/Strings.h>
|
||||
#include <stdexcept>
|
||||
#include <system_error>
|
||||
|
||||
// Macro copied from https://en.cppreference.com/w/cpp/error/assert
|
||||
// Use (void) to silent unused warnings.
|
||||
#define assertm(exp, msg) assert(((void)msg, exp))
|
||||
|
||||
namespace fair::mq {
|
||||
|
||||
struct RuntimeError : ::std::runtime_error
|
||||
|
|
Loading…
Reference in New Issue
Block a user