GEOSX
Macros
Macros.hpp File Reference

Contains a bunch of macro definitions. More...

#include "LvArrayConfig.hpp"
#include "system.hpp"
#include <fstream>
#include <sstream>
#include <iostream>
#include <type_traits>

Go to the source code of this file.

Macros

#define STRINGIZE_NX(A)   #A
 Convert A into a string. More...
 
#define STRINGIZE(A)   STRINGIZE_NX( A )
 Convert the macro expansion of A into a string. More...
 
#define LVARRAY_UNUSED_ARG(X)
 Mark X as an unused argument, used to silence compiler warnings. More...
 
#define LVARRAY_UNUSED_VARIABLE(X)   ( ( void ) X )
 Mark X as an unused variable, used to silence compiler warnings. More...
 
#define LVARRAY_DEBUG_VAR(X)   LVARRAY_UNUSED_VARIABLE( X )
 Mark X as an debug variable, used to silence compiler warnings. More...
 
#define LOCATION   __FILE__ ":" STRINGIZE( __LINE__ )
 Expands to a string representing the current file and line.
 
#define TYPEOFPTR(X)   std::remove_pointer_t< decltype( X ) >
 Given an expression X that evaluates to a pointer, expands to the type pointed to. More...
 
#define TYPEOFREF(X)   std::remove_reference_t< decltype( X ) >
 Given an expression X that evaluates to a reference, expands to the type referred to. More...
 
#define LVARRAY_LOG(...)   std::cout << __VA_ARGS__ << std::endl
 Print the expression.
 
#define LVARRAY_LOG_VAR(...)   LVARRAY_LOG( STRINGIZE( __VA_ARGS__ ) << " = " << __VA_ARGS__ )
 Print the expression string along with its value.
 
#define LVARRAY_ERROR_IF(EXP, MSG)
 Abort execution if EXP is true. More...
 
#define LVARRAY_ERROR(MSG)   LVARRAY_ERROR_IF( true, MSG )
 Abort execution. More...
 
#define LVARRAY_ASSERT_MSG(EXP, MSG)   LVARRAY_ERROR_IF( !(EXP), MSG )
 Abort execution if EXP is false but only when NDEBUG is not defined.. More...
 
#define LVARRAY_ASSERT(EXP)   LVARRAY_ASSERT_MSG( EXP, "" )
 Assert EXP is true with no message.
 
#define LVARRAY_WARNING_IF(EXP, MSG)
 Print a warning if EXP is true. More...
 
#define LVARRAY_WARNING(MSG)   LVARRAY_WARNING_IF( true, MSG )
 Print a warning with a message. More...
 
#define LVARRAY_INFO_IF(EXP, MSG)
 Print msg along with the location if EXP is true. More...
 
#define LVARRAY_INFO(msg)   LVARRAY_INFO_IF( true, msg )
 Print msg along with the location. More...
 
#define LVARRAY_ERROR_IF_OP_MSG(lhs, OP, NOP, rhs, msg)
 Abort execution if lhs OP rhs. More...
 
#define LVARRAY_ERROR_IF_EQ_MSG(lhs, rhs, msg)   LVARRAY_ERROR_IF_OP_MSG( lhs, ==, !=, rhs, msg )
 Raise a hard error if two values are equal. More...
 
#define LVARRAY_ERROR_IF_EQ(lhs, rhs)   LVARRAY_ERROR_IF_EQ_MSG( lhs, rhs, "" )
 Raise a hard error if two values are equal. More...
 
#define LVARRAY_ERROR_IF_NE_MSG(lhs, rhs, msg)   LVARRAY_ERROR_IF_OP_MSG( lhs, !=, ==, rhs, msg )
 Raise a hard error if two values are not equal. More...
 
#define LVARRAY_ERROR_IF_NE(lhs, rhs)   LVARRAY_ERROR_IF_NE_MSG( lhs, rhs, "" )
 Raise a hard error if two values are not equal. More...
 
#define LVARRAY_ERROR_IF_GT_MSG(lhs, rhs, msg)   LVARRAY_ERROR_IF_OP_MSG( lhs, >, <=, rhs, msg )
 Raise a hard error if one value compares greater than the other. More...
 
#define LVARRAY_ERROR_IF_GT(lhs, rhs)   LVARRAY_ERROR_IF_GT_MSG( lhs, rhs, "" )
 Raise a hard error if one value compares greater than the other. More...
 
#define LVARRAY_ERROR_IF_GE_MSG(lhs, rhs, msg)   LVARRAY_ERROR_IF_OP_MSG( lhs, >=, <, rhs, msg )
 Raise a hard error if one value compares greater than or equal to the other. More...
 
#define LVARRAY_ERROR_IF_GE(lhs, rhs)   LVARRAY_ERROR_IF_GE_MSG( lhs, rhs, "" )
 Raise a hard error if one value compares greater than or equal to the other. More...
 
#define LVARRAY_ERROR_IF_LT_MSG(lhs, rhs, msg)   LVARRAY_ERROR_IF_OP_MSG( lhs, <, >=, rhs, msg )
 Raise a hard error if one value compares less than the other. More...
 
#define LVARRAY_ERROR_IF_LT(lhs, rhs)   LVARRAY_ERROR_IF_LT_MSG( lhs, rhs, "" )
 Raise a hard error if one value compares less than the other. More...
 
#define LVARRAY_ERROR_IF_LE_MSG(lhs, rhs, msg)   LVARRAY_ERROR_IF_OP_MSG( lhs, <=, >, rhs, msg )
 Raise a hard error if one value compares less than or equal to the other. More...
 
#define LVARRAY_ERROR_IF_LE(lhs, rhs)   LVARRAY_ERROR_IF_GE_MSG( lhs, rhs, "" )
 Raise a hard error if one value compares less than or equal to the other. More...
 
#define LVARRAY_ASSERT_OP_MSG(lhs, OP, rhs, msg)
 Abort execution if lhs OP rhs is false. More...
 
#define LVARRAY_ASSERT_EQ_MSG(lhs, rhs, msg)   LVARRAY_ASSERT_OP_MSG( lhs, ==, rhs, msg )
 Assert that two values compare equal in debug builds. More...
 
#define LVARRAY_ASSERT_EQ(lhs, rhs)   LVARRAY_ASSERT_EQ_MSG( lhs, rhs, "" )
 Assert that two values compare equal in debug builds. More...
 
#define LVARRAY_ASSERT_NE_MSG(lhs, rhs, msg)   LVARRAY_ASSERT_OP_MSG( lhs, !=, rhs, msg )
 Assert that two values compare not equal in debug builds. More...
 
#define LVARRAY_ASSERT_NE(lhs, rhs)   LVARRAY_ASSERT_NE_MSG( lhs, rhs, "" )
 Assert that two values compare not equal in debug builds. More...
 
#define LVARRAY_ASSERT_GT_MSG(lhs, rhs, msg)   LVARRAY_ASSERT_OP_MSG( lhs, >, rhs, msg )
 Assert that one value compares greater than the other in debug builds. More...
 
#define LVARRAY_ASSERT_GT(lhs, rhs)   LVARRAY_ASSERT_GT_MSG( lhs, rhs, "" )
 Assert that one value compares greater than the other in debug builds. More...
 
#define LVARRAY_ASSERT_GE_MSG(lhs, rhs, msg)   LVARRAY_ASSERT_OP_MSG( lhs, >=, rhs, msg )
 Assert that one value compares greater than or equal to the other in debug builds. More...
 
#define LVARRAY_ASSERT_GE(lhs, rhs)   LVARRAY_ASSERT_GE_MSG( lhs, rhs, "" )
 Assert that one value compares greater than or equal to the other in debug builds. More...
 
#define LVARRAY_HOST_DEVICE
 Mark a function for both host and device usage.
 
#define LVARRAY_DEVICE
 Mark a function for only device usage.
 
#define DISABLE_HD_WARNING
 Disable host device warnings. More...
 
#define CONSTEXPR_WITHOUT_BOUNDS_CHECK   constexpr
 Expands to constexpr when array bound checking is disabled.
 
#define CONSTEXPR_WITH_NDEBUG
 Expands to constexpr in release builds (when NDEBUG is defined).
 
#define CONSTEXPR_WITHOUT_BOUNDS_CHECK   constexpr
 Expands to constexpr when array bound checking is disabled.
 
#define CONSTEXPR_WITH_NDEBUG
 Expands to constexpr in release builds (when NDEBUG is defined).
 

Detailed Description

Contains a bunch of macro definitions.

Definition in file Macros.hpp.

Macro Definition Documentation

◆ DISABLE_HD_WARNING

#define DISABLE_HD_WARNING

Disable host device warnings.

This pragma disables nvcc warnings about calling a host function from a host-device function. This is used on templated host-device functions where some template instantiations call host only code. This is safe as long as the host only instantiations are only called on the host. To use place directly above a the template.

Definition at line 401 of file Macros.hpp.

◆ LVARRAY_ASSERT_EQ

#define LVARRAY_ASSERT_EQ (   lhs,
  rhs 
)    LVARRAY_ASSERT_EQ_MSG( lhs, rhs, "" )

Assert that two values compare equal in debug builds.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison

Definition at line 325 of file Macros.hpp.

◆ LVARRAY_ASSERT_EQ_MSG

#define LVARRAY_ASSERT_EQ_MSG (   lhs,
  rhs,
  msg 
)    LVARRAY_ASSERT_OP_MSG( lhs, ==, rhs, msg )

Assert that two values compare equal in debug builds.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
msga message to log (any expression that can be stream inserted)

Definition at line 318 of file Macros.hpp.

◆ LVARRAY_ASSERT_GE

#define LVARRAY_ASSERT_GE (   lhs,
  rhs 
)    LVARRAY_ASSERT_GE_MSG( lhs, rhs, "" )

Assert that one value compares greater than or equal to the other in debug builds.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison

Definition at line 370 of file Macros.hpp.

◆ LVARRAY_ASSERT_GE_MSG

#define LVARRAY_ASSERT_GE_MSG (   lhs,
  rhs,
  msg 
)    LVARRAY_ASSERT_OP_MSG( lhs, >=, rhs, msg )

Assert that one value compares greater than or equal to the other in debug builds.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
msga message to log (any expression that can be stream inserted)

Definition at line 363 of file Macros.hpp.

◆ LVARRAY_ASSERT_GT

#define LVARRAY_ASSERT_GT (   lhs,
  rhs 
)    LVARRAY_ASSERT_GT_MSG( lhs, rhs, "" )

Assert that one value compares greater than the other in debug builds.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison

Definition at line 355 of file Macros.hpp.

◆ LVARRAY_ASSERT_GT_MSG

#define LVARRAY_ASSERT_GT_MSG (   lhs,
  rhs,
  msg 
)    LVARRAY_ASSERT_OP_MSG( lhs, >, rhs, msg )

Assert that one value compares greater than the other in debug builds.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
msga message to log (any expression that can be stream inserted)

Definition at line 348 of file Macros.hpp.

◆ LVARRAY_ASSERT_MSG

#define LVARRAY_ASSERT_MSG (   EXP,
  MSG 
)    LVARRAY_ERROR_IF( !(EXP), MSG )

Abort execution if EXP is false but only when NDEBUG is not defined..

Parameters
EXPThe expression to check.
MSGThe message to associate with the error, can be anything streamable to std::cout.
Note
This macro can be used in both host and device code.
Tries to provide as much information about the location of the error as possible. On host this should result in the file and line of the error and a stack trace along with the provided message. On device none of this is guaranteed. In fact it is only guaranteed to abort the current kernel.

Definition at line 136 of file Macros.hpp.

◆ LVARRAY_ASSERT_NE

#define LVARRAY_ASSERT_NE (   lhs,
  rhs 
)    LVARRAY_ASSERT_NE_MSG( lhs, rhs, "" )

Assert that two values compare not equal in debug builds.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison

Definition at line 340 of file Macros.hpp.

◆ LVARRAY_ASSERT_NE_MSG

#define LVARRAY_ASSERT_NE_MSG (   lhs,
  rhs,
  msg 
)    LVARRAY_ASSERT_OP_MSG( lhs, !=, rhs, msg )

Assert that two values compare not equal in debug builds.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
msga message to log (any expression that can be stream inserted)

Definition at line 333 of file Macros.hpp.

◆ LVARRAY_ASSERT_OP_MSG

#define LVARRAY_ASSERT_OP_MSG (   lhs,
  OP,
  rhs,
  msg 
)
Value:
LVARRAY_ASSERT_MSG( lhs OP rhs, \
msg << "\n" << \
" " << #lhs << " = " << lhs << "\n" << \
" " << #rhs << " = " << rhs << "\n" )
#define LVARRAY_ASSERT_MSG(EXP, MSG)
Abort execution if EXP is false but only when NDEBUG is not defined..
Definition: Macros.hpp:136

Abort execution if lhs OP rhs is false.

Parameters
lhsThe left side of the operation.
OPThe operation to apply.
rhsThe right side of the operation.
msgThe message to diplay.

Definition at line 306 of file Macros.hpp.

◆ LVARRAY_DEBUG_VAR

#define LVARRAY_DEBUG_VAR (   X)    LVARRAY_UNUSED_VARIABLE( X )

Mark X as an debug variable, used to silence compiler warnings.

Parameters
Xthe debug variable.

Definition at line 57 of file Macros.hpp.

◆ LVARRAY_ERROR

#define LVARRAY_ERROR (   MSG)    LVARRAY_ERROR_IF( true, MSG )

Abort execution.

Parameters
MSGThe message to associate with the error, can be anything streamable to std::cout.

Definition at line 122 of file Macros.hpp.

◆ LVARRAY_ERROR_IF

#define LVARRAY_ERROR_IF (   EXP,
  MSG 
)
Value:
do \
{ \
if( EXP ) \
{ \
std::ostringstream __oss; \
__oss << "***** ERROR\n"; \
__oss << "***** LOCATION: " LOCATION "\n"; \
__oss << "***** Controlling expression (should be false): " STRINGIZE( EXP ) "\n"; \
__oss << MSG << "\n"; \
__oss << LvArray::system::stackTrace( true ); \
std::cout << __oss.str() << std::endl; \
} \
} while( false )
std::string stackTrace(bool const lineInfo)
Return a demangled stack trace of the last 25 frames.
#define STRINGIZE(A)
Convert the macro expansion of A into a string.
Definition: Macros.hpp:39
#define LOCATION
Expands to a string representing the current file and line.
Definition: Macros.hpp:60
void callErrorHandler()
Call the error handler, by default this is std::abort.

Abort execution if EXP is true.

Parameters
EXPThe expression to check.
MSGThe message to associate with the error, can be anything streamable to std::cout.
Note
This macro can be used in both host and device code.
Tries to provide as much information about the location of the error as possible. On host this should result in the file and line of the error and a stack trace along with the provided message. On device none of this is guaranteed. In fact it is only guaranteed to abort the current kernel.

Definition at line 101 of file Macros.hpp.

◆ LVARRAY_ERROR_IF_EQ

#define LVARRAY_ERROR_IF_EQ (   lhs,
  rhs 
)    LVARRAY_ERROR_IF_EQ_MSG( lhs, rhs, "" )

Raise a hard error if two values are equal.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison

Definition at line 222 of file Macros.hpp.

◆ LVARRAY_ERROR_IF_EQ_MSG

#define LVARRAY_ERROR_IF_EQ_MSG (   lhs,
  rhs,
  msg 
)    LVARRAY_ERROR_IF_OP_MSG( lhs, ==, !=, rhs, msg )

Raise a hard error if two values are equal.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
msga message to log (any expression that can be stream inserted)

Definition at line 215 of file Macros.hpp.

◆ LVARRAY_ERROR_IF_GE

#define LVARRAY_ERROR_IF_GE (   lhs,
  rhs 
)    LVARRAY_ERROR_IF_GE_MSG( lhs, rhs, "" )

Raise a hard error if one value compares greater than or equal to the other.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison

Definition at line 267 of file Macros.hpp.

◆ LVARRAY_ERROR_IF_GE_MSG

#define LVARRAY_ERROR_IF_GE_MSG (   lhs,
  rhs,
  msg 
)    LVARRAY_ERROR_IF_OP_MSG( lhs, >=, <, rhs, msg )

Raise a hard error if one value compares greater than or equal to the other.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
msga message to log (any expression that can be stream inserted)

Definition at line 260 of file Macros.hpp.

◆ LVARRAY_ERROR_IF_GT

#define LVARRAY_ERROR_IF_GT (   lhs,
  rhs 
)    LVARRAY_ERROR_IF_GT_MSG( lhs, rhs, "" )

Raise a hard error if one value compares greater than the other.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison

Definition at line 252 of file Macros.hpp.

◆ LVARRAY_ERROR_IF_GT_MSG

#define LVARRAY_ERROR_IF_GT_MSG (   lhs,
  rhs,
  msg 
)    LVARRAY_ERROR_IF_OP_MSG( lhs, >, <=, rhs, msg )

Raise a hard error if one value compares greater than the other.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
msga message to log (any expression that can be stream inserted)

Definition at line 245 of file Macros.hpp.

◆ LVARRAY_ERROR_IF_LE

#define LVARRAY_ERROR_IF_LE (   lhs,
  rhs 
)    LVARRAY_ERROR_IF_GE_MSG( lhs, rhs, "" )

Raise a hard error if one value compares less than or equal to the other.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison

Definition at line 297 of file Macros.hpp.

◆ LVARRAY_ERROR_IF_LE_MSG

#define LVARRAY_ERROR_IF_LE_MSG (   lhs,
  rhs,
  msg 
)    LVARRAY_ERROR_IF_OP_MSG( lhs, <=, >, rhs, msg )

Raise a hard error if one value compares less than or equal to the other.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
msga message to log (any expression that can be stream inserted)

Definition at line 290 of file Macros.hpp.

◆ LVARRAY_ERROR_IF_LT

#define LVARRAY_ERROR_IF_LT (   lhs,
  rhs 
)    LVARRAY_ERROR_IF_LT_MSG( lhs, rhs, "" )

Raise a hard error if one value compares less than the other.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison

Definition at line 282 of file Macros.hpp.

◆ LVARRAY_ERROR_IF_LT_MSG

#define LVARRAY_ERROR_IF_LT_MSG (   lhs,
  rhs,
  msg 
)    LVARRAY_ERROR_IF_OP_MSG( lhs, <, >=, rhs, msg )

Raise a hard error if one value compares less than the other.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
msga message to log (any expression that can be stream inserted)

Definition at line 275 of file Macros.hpp.

◆ LVARRAY_ERROR_IF_NE

#define LVARRAY_ERROR_IF_NE (   lhs,
  rhs 
)    LVARRAY_ERROR_IF_NE_MSG( lhs, rhs, "" )

Raise a hard error if two values are not equal.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison

Definition at line 237 of file Macros.hpp.

◆ LVARRAY_ERROR_IF_NE_MSG

#define LVARRAY_ERROR_IF_NE_MSG (   lhs,
  rhs,
  msg 
)    LVARRAY_ERROR_IF_OP_MSG( lhs, !=, ==, rhs, msg )

Raise a hard error if two values are not equal.

Parameters
lhsexpression to be evaluated and used as left-hand side in comparison
rhsexpression to be evaluated and used as right-hand side in comparison
msga message to log (any expression that can be stream inserted)

Definition at line 230 of file Macros.hpp.

◆ LVARRAY_ERROR_IF_OP_MSG

#define LVARRAY_ERROR_IF_OP_MSG (   lhs,
  OP,
  NOP,
  rhs,
  msg 
)
Value:
LVARRAY_ERROR_IF( lhs OP rhs, \
msg << "\n" << \
"Expected " << #lhs << " " << #NOP << " " << #rhs << "\n" << \
" " << #lhs << " = " << lhs << "\n" << \
" " << #rhs << " = " << rhs << "\n" )
#define LVARRAY_ERROR_IF(EXP, MSG)
Abort execution if EXP is true.
Definition: Macros.hpp:101

Abort execution if lhs OP rhs.

Parameters
lhsThe left side of the operation.
OPThe operation to apply.
NOPThe opposite of OP, used in the message.
rhsThe right side of the operation.
msgThe message to diplay.

Definition at line 202 of file Macros.hpp.

◆ LVARRAY_INFO

#define LVARRAY_INFO (   msg)    LVARRAY_INFO_IF( true, msg )

Print msg along with the location.

Parameters
msgThe message to print.

Definition at line 192 of file Macros.hpp.

◆ LVARRAY_INFO_IF

#define LVARRAY_INFO_IF (   EXP,
  MSG 
)
Value:
do \
{ \
if( EXP ) \
{ \
std::ostringstream __oss; \
__oss << "***** INFO\n"; \
__oss << "***** LOCATION: " LOCATION "\n"; \
__oss << "***** Controlling expression: " STRINGIZE( EXP ) "\n"; \
__oss << MSG; \
std::cout << __oss.str() << std::endl; \
} \
} while( false )
#define STRINGIZE(A)
Convert the macro expansion of A into a string.
Definition: Macros.hpp:39
#define LOCATION
Expands to a string representing the current file and line.
Definition: Macros.hpp:60

Print msg along with the location if EXP is true.

Parameters
EXPThe expression to test.
MSGThe message to print.

Definition at line 174 of file Macros.hpp.

◆ LVARRAY_UNUSED_ARG

#define LVARRAY_UNUSED_ARG (   X)

Mark X as an unused argument, used to silence compiler warnings.

Parameters
Xthe unused argument.

Definition at line 45 of file Macros.hpp.

◆ LVARRAY_UNUSED_VARIABLE

#define LVARRAY_UNUSED_VARIABLE (   X)    ( ( void ) X )

Mark X as an unused variable, used to silence compiler warnings.

Parameters
Xthe unused variable.

Definition at line 51 of file Macros.hpp.

◆ LVARRAY_WARNING

#define LVARRAY_WARNING (   MSG)    LVARRAY_WARNING_IF( true, MSG )

Print a warning with a message.

Parameters
MSGThe message to print.

Definition at line 167 of file Macros.hpp.

◆ LVARRAY_WARNING_IF

#define LVARRAY_WARNING_IF (   EXP,
  MSG 
)
Value:
do \
{ \
if( EXP ) \
{ \
std::ostringstream __oss; \
__oss << "***** WARNING\n"; \
__oss << "***** LOCATION: " LOCATION "\n"; \
__oss << "***** Controlling expression (should be false): " STRINGIZE( EXP ) "\n"; \
__oss << MSG; \
std::cout << __oss.str() << std::endl; \
} \
} while( false )
#define STRINGIZE(A)
Convert the macro expansion of A into a string.
Definition: Macros.hpp:39
#define LOCATION
Expands to a string representing the current file and line.
Definition: Macros.hpp:60

Print a warning if EXP is true.

Parameters
EXPThe expression to check.
MSGThe message to associate with the warning, can be anything streamable to std::cout.

Definition at line 149 of file Macros.hpp.

◆ STRINGIZE

#define STRINGIZE (   A)    STRINGIZE_NX( A )

Convert the macro expansion of A into a string.

Parameters
Athe token to convert to a string.

Definition at line 39 of file Macros.hpp.

◆ STRINGIZE_NX

#define STRINGIZE_NX (   A)    #A

Convert A into a string.

Parameters
Athe token to convert to a string.

Definition at line 33 of file Macros.hpp.

◆ TYPEOFPTR

#define TYPEOFPTR (   X)    std::remove_pointer_t< decltype( X ) >

Given an expression X that evaluates to a pointer, expands to the type pointed to.

Parameters
XThe expression to evaluate.

Definition at line 66 of file Macros.hpp.

◆ TYPEOFREF

#define TYPEOFREF (   X)    std::remove_reference_t< decltype( X ) >

Given an expression X that evaluates to a reference, expands to the type referred to.

Parameters
XThe expression to evaluate.

Definition at line 72 of file Macros.hpp.