SUPPRESS_TEMPORARY_REF

Macros to suppress compiler warnings for different compilers.

Defines

_SUPPRESS_WARNING_START

Fallback for _SUPPRESS_WARNING_START (no-op)

_SUPPRESS_WARNING_END

Fallback for _SUPPRESS_WARNING_END (no-op)

_SUPPRESS_TEMPORARY_RETURN_CODE

Fallback for _SUPPRESS_TEMPORARY_RETURN_CODE (no-op)

SUPPRESS_TEMPORARY_REF(CODEBLOCK) _SUPPRESS_WARNING_START                                                      \   _SUPPRESS_TEMPORARY_RETURN_CODE

\

CODEBLOCK                                                                    \

_SUPPRESS_WARNING_END

Suppress warnings about returning reference to temporary.

This macro wraps a code block to suppress compiler warnings about returning the address of a local variable or temporary. It handles compiler-specific pragmas for MSVC, GCC, Clang, and Intel LLVM.

Parameters:
  • CODEBLOCK – The code to be executed with the warning suppressed.