Add Q_DECL_RELAXED_CONSTEXPR macro
Expands to constexpr if C++14 relaxed constepxr are supported by the compiler [ChangeLog][QtCore] Added Q_DECL_RELAXED_CONSTEXPR for the corresponding C++14 feature Change-Id: Id6b56b3a17da2ff838c80795e528e1247dc13f63 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
6e1718987e
commit
eaa4496efa
@ -28,6 +28,7 @@ Cpp.ignoretokens += \
|
||||
Q_CORE_EXPORT_INLINE \
|
||||
Q_DBUS_EXPORT \
|
||||
Q_DECL_CONSTEXPR \
|
||||
Q_DECL_RELAXED_CONSTEXPR \
|
||||
Q_DECL_CONST_FUNCTION \
|
||||
Q_DECL_DEPRECATED \
|
||||
Q_DECL_NOEXCEPT \
|
||||
|
@ -916,12 +916,21 @@
|
||||
# define Q_COMPILER_DEFAULT_DELETE_MEMBERS
|
||||
#endif
|
||||
|
||||
#ifdef Q_COMPILER_CONSTEXPR
|
||||
#if defined(__cpp_constexpr) && __cpp_constexpr-0 >= 201304
|
||||
# define Q_DECL_CONSTEXPR constexpr
|
||||
# define Q_DECL_RELAXED_CONSTEXPR constexpr
|
||||
# define Q_CONSTEXPR constexpr
|
||||
# define Q_RELAXED_CONSTEXPR constexpr
|
||||
#elif defined Q_COMPILER_CONSTEXPR
|
||||
# define Q_DECL_CONSTEXPR constexpr
|
||||
# define Q_DECL_RELAXED_CONSTEXPR
|
||||
# define Q_CONSTEXPR constexpr
|
||||
# define Q_RELAXED_CONSTEXPR const
|
||||
#else
|
||||
# define Q_DECL_CONSTEXPR
|
||||
# define Q_DECL_RELAXED_CONSTEXPR
|
||||
# define Q_CONSTEXPR const
|
||||
# define Q_RELAXED_CONSTEXPR const
|
||||
#endif
|
||||
|
||||
#ifdef Q_COMPILER_EXPLICIT_OVERRIDES
|
||||
|
@ -3940,6 +3940,21 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters)
|
||||
|
||||
It expands to "constexpr" if your compiler supports that C++11 keyword, or to nothing
|
||||
otherwise.
|
||||
|
||||
\sa Q_DECL_RELAXED_CONSTEXPR
|
||||
*/
|
||||
|
||||
/*!
|
||||
\macro Q_DECL_RELAXED_CONSTEXPR
|
||||
\relates <QtGlobal>
|
||||
|
||||
This macro can be used to declare an inline function that can be computed
|
||||
at compile-time according to the relaxed rules from C++14.
|
||||
|
||||
It expands to "constexpr" if your compiler supports C++14 relaxed constant
|
||||
expressions, or to nothing otherwise.
|
||||
|
||||
\sa Q_DECL_CONSTEXPR
|
||||
*/
|
||||
|
||||
/*!
|
||||
|
Loading…
Reference in New Issue
Block a user