CommonLib
Loading...
Searching...
No Matches
Preprocessor.h File Reference

Go to the source code of this file.

Macros

#define SAFE_DELETE(PTR)
#define ASSERT_RETURN(CONDITION, RETURN_VALUE)
#define ASSERT_RETURN_TRUE(CONDITION)
#define ASSERT_RETURN_FALSE(CONDITION)

Macro Definition Documentation

◆ ASSERT_RETURN

#define ASSERT_RETURN ( CONDITION,
RETURN_VALUE )
Value:
if (!(CONDITION)) return RETURN_VALUE;

Returns a value if the condition is not met.

Parameters
CONDITIONThe condition to check.
RETURN_VALUEThe value to return.

◆ ASSERT_RETURN_FALSE

#define ASSERT_RETURN_FALSE ( CONDITION)
Value:
ASSERT_RETURN(CONDITION, false)
#define ASSERT_RETURN(CONDITION, RETURN_VALUE)
Definition Preprocessor.h:17

Returns false if the condition is not met.

Parameters
CONDITIONThe condition to check.

◆ ASSERT_RETURN_TRUE

#define ASSERT_RETURN_TRUE ( CONDITION)
Value:
ASSERT_RETURN(CONDITION, true)

Returns true if the condition is not met.

Parameters
CONDITIONThe condition to check.

◆ SAFE_DELETE

#define SAFE_DELETE ( PTR)
Value:
if (PTR) { delete PTR; PTR = nullptr; }

Deletes an object and resets its pointer.

Parameters
PTRThe pointer to the object to delete.