Skip to content

Commit

Permalink
common/Compiler: make NOEXCEPT definition not conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
illwieckz committed Jun 20, 2024
1 parent c98d551 commit 3cbe309
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions src/common/Compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,15 +250,14 @@ See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0627r0.pdf */

// Keywords specific to C++ versions

/* The noexcept keyword should be used on all move constructors and move
/* TODO: Rewrite all NOEXCEPT usages from the whole code base.
The noexcept keyword should be used on all move constructors and move
assignments so that containers move objects instead of copying them.
The noexcept keyword was added in C++11 but the __cpp_noexcept_function_type
definition to detect its implementation was only added in C++17. */
#if defined(__cpp_noexcept_function_type) || __cplusplus >= 201103
#define NOEXCEPT noexcept
#define NOEXCEPT_IF(x) noexcept(x)
#define NOEXCEPT_EXPR(x) noexcept(x)
#endif
That keyword was added in C++11, all compilers should now support it. */
#define NOEXCEPT noexcept
#define NOEXCEPT_IF(x) noexcept(x)
#define NOEXCEPT_EXPR(x) noexcept(x)

// Uses SD-6 Feature Test Recommendations
#if defined(__cpp_constexpr)
Expand All @@ -270,15 +269,6 @@ definition to detect its implementation was only added in C++17. */
#endif

// Work around lack of language keywords.
#if !defined(NOEXCEPT)
#define NOEXCEPT
#endif
#if !defined(NOEXCEPT_IF)
#define NOEXCEPT_IF(x)
#endif
#if !defined(NOEXCEPT_EXPR)
#define NOEXCEPT_EXPR(x) x
#endif
#if !defined(CONSTEXPR)
#define CONSTEXPR
#endif
Expand Down

0 comments on commit 3cbe309

Please sign in to comment.