Ariles
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Macros
exception.h File Reference

Detailed Description

Throw & assert macro.

Author
Alexander Sherikov

Definition in file exception.h.

Go to the source code of this file.

#include <stdexcept>
#include "concat.h"

Macros

#define CPPUT_THROW_EXCEPTION(exception_type, message)   throw exception_type((message))
 
#define CPPUT_THROW(...)    CPPUT_THROW_EXCEPTION(std::runtime_error, cpput::concat::simple("In ", __func__, "() // ", __VA_ARGS__))
 
#define CPPUT_PERSISTENT_ASSERT(condition, ...)
 
#define CPPUT_ASSERT(condition, ...)   CPPUT_PERSISTENT_ASSERT(condition, __VA_ARGS__)
 

Macro Definition Documentation

◆ CPPUT_ASSERT

#define CPPUT_ASSERT (   condition,
  ... 
)    CPPUT_PERSISTENT_ASSERT(condition, __VA_ARGS__)

Definition at line 32 of file exception.h.

◆ CPPUT_PERSISTENT_ASSERT

#define CPPUT_PERSISTENT_ASSERT (   condition,
  ... 
)
Value:
if (!(condition)) /* NOLINT */ \
{ \
CPPUT_THROW(__VA_ARGS__); \
};

Definition at line 23 of file exception.h.

◆ CPPUT_THROW

#define CPPUT_THROW (   ...)     CPPUT_THROW_EXCEPTION(std::runtime_error, cpput::concat::simple("In ", __func__, "() // ", __VA_ARGS__))

Definition at line 19 of file exception.h.

◆ CPPUT_THROW_EXCEPTION

#define CPPUT_THROW_EXCEPTION (   exception_type,
  message 
)    throw exception_type((message))

Definition at line 17 of file exception.h.