Skip to content

Commit

Permalink
Utility: added a CORRADE_CONSTEXPR14 macro.
Browse files Browse the repository at this point in the history
  • Loading branch information
mosra committed Feb 19, 2020
1 parent 5ab65bf commit 9cf91f0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
3 changes: 3 additions & 0 deletions doc/corrade-changelog.dox
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ namespace Corrade {
- New @ref CORRADE_TARGET_BIG_ENDIAN macro. A variant of this macro called
just @cpp CORRADE_BIG_ENDIAN @ce was used internally for a long time, now
it's been exposed publicly.
- New @ref CORRADE_CONSTEXPR14 macro for marking @cpp constexpr @ce functions
that make use of C++14 relaxed constexpr rules but still need to work under
C++11 as well.

@subsubsection corrade-changelog-latest-new-containers Containers library

Expand Down
16 changes: 15 additions & 1 deletion src/Corrade/Utility/Macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/

/** @file
* @brief Macro @ref CORRADE_DEPRECATED(), @ref CORRADE_DEPRECATED_ALIAS(), @ref CORRADE_DEPRECATED_NAMESPACE(), @ref CORRADE_DEPRECATED_ENUM(), @ref CORRADE_DEPRECATED_FILE(), @ref CORRADE_DEPRECATED_MACRO(), @ref CORRADE_IGNORE_DEPRECATED_PUSH, @ref CORRADE_IGNORE_DEPRECATED_POP, @ref CORRADE_UNUSED, @ref CORRADE_ALIGNAS(), @ref CORRADE_NORETURN, @ref CORRADE_FALLTHROUGH, @ref CORRADE_THREAD_LOCAL, @ref CORRADE_ALWAYS_INLINE, @ref CORRADE_NEVER_INLINE, @ref CORRADE_FUNCTION, @ref CORRADE_LINE_STRING, @ref CORRADE_AUTOMATIC_INITIALIZER(), @ref CORRADE_AUTOMATIC_FINALIZER()
* @brief Macro @ref CORRADE_DEPRECATED(), @ref CORRADE_DEPRECATED_ALIAS(), @ref CORRADE_DEPRECATED_NAMESPACE(), @ref CORRADE_DEPRECATED_ENUM(), @ref CORRADE_DEPRECATED_FILE(), @ref CORRADE_DEPRECATED_MACRO(), @ref CORRADE_IGNORE_DEPRECATED_PUSH, @ref CORRADE_IGNORE_DEPRECATED_POP, @ref CORRADE_UNUSED, @ref CORRADE_ALIGNAS(), @ref CORRADE_NORETURN, @ref CORRADE_FALLTHROUGH, @ref CORRADE_THREAD_LOCAL, @ref CORRADE_CONSTEXPR14, @ref CORRADE_ALWAYS_INLINE, @ref CORRADE_NEVER_INLINE, @ref CORRADE_FUNCTION, @ref CORRADE_LINE_STRING, @ref CORRADE_AUTOMATIC_INITIALIZER(), @ref CORRADE_AUTOMATIC_FINALIZER()
*/

#include "Corrade/configure.h"
Expand Down Expand Up @@ -345,6 +345,20 @@ regarding RAII.
#define CORRADE_THREAD_LOCAL thread_local
#endif

/** @hideinitializer
@brief C++14 constexpr
@m_since_latest
Expands to @cpp constexpr @ce on C++14 and newer, empty on C++11. Useful for
selectively marking functions that make use of C++14 relaxed constexpr rules.
@see @ref CORRADE_CXX_STANDARD
*/
#if CORRADE_CXX_STANDARD >= 201402
#define CORRADE_CONSTEXPR14 constexpr
#else
#define CORRADE_CONSTEXPR14
#endif

/** @hideinitializer
@brief Always inline a function
@m_since{2019,10}
Expand Down

0 comments on commit 9cf91f0

Please sign in to comment.