Donner
C++20 SVG rendering library
Loading...
Searching...
No Matches
Utils.h File Reference
#include <cassert>
#include <cstdio>
Include dependency graph for Utils.h:
This graph shows which files directly or indirectly include this file:

Macros

#define UTILS_PREDICT_TRUE(x)   (x)
 A hint to the compiler that the expression x is likely to evaluate to true.
 
#define UTILS_PREDICT_FALSE(x)   (x)
 A hint to the compiler that the expression x is likely to evaluate to false.
 
#define UTILS_UNREACHABLE()
 A hint to the compiler that the code following this macro is unreachable.
 
#define UTILS_RELEASE_ASSERT(x)   assert(x)
 An assert that evaluates on both release and debug builds.
 
#define UTILS_RELEASE_ASSERT_MSG(x, msg)   assert((x) && (msg))
 An assert that evaluates on both release and debug builds and errors with the provided msg.
 
#define UTILS_EXCEPTIONS_ENABLED()   false
 Returns true if exceptions are enabled, false otherwise.
 

Macro Definition Documentation

◆ UTILS_PREDICT_FALSE

#define UTILS_PREDICT_FALSE ( x)    (x)

A hint to the compiler that the expression x is likely to evaluate to false.

Parameters
xThe expression to evaluate.

◆ UTILS_PREDICT_TRUE

#define UTILS_PREDICT_TRUE ( x)    (x)

A hint to the compiler that the expression x is likely to evaluate to true.

Parameters
xThe expression to evaluate.

◆ UTILS_RELEASE_ASSERT

#define UTILS_RELEASE_ASSERT ( x)    assert(x)

An assert that evaluates on both release and debug builds.

Asserts that x is true in release builds, stopping execution with an abort. On debug builds, falls back to an assert.

Parameters
xThe expression to evaluate.

◆ UTILS_RELEASE_ASSERT_MSG

#define UTILS_RELEASE_ASSERT_MSG ( x,
msg )   assert((x) && (msg))

An assert that evaluates on both release and debug builds and errors with the provided msg.

Asserts that x is true in release builds, stopping execution with an abort. On debug builds, falls back to an assert.

Parameters
xThe expression to evaluate.
msgA message to print if the assertion fails.
Examples
svg_tree_interaction.cc.