diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2014-08-23 18:26:01 +0200 |
---|---|---|
committer | Olivier Goffart <ogoffart@woboq.com> | 2014-10-24 22:22:09 +0200 |
commit | eaa4496efab49844dfe3b46ada73cc02f99dba7a (patch) | |
tree | bd443abbe9d5abe7b9752989316fdf27ea6cad56 /src/corelib/global/qcompilerdetection.h | |
parent | 6e1718987e0f781bfd4f7036cc404f762c2301a8 (diff) |
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>
Diffstat (limited to 'src/corelib/global/qcompilerdetection.h')
-rw-r--r-- | src/corelib/global/qcompilerdetection.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index 8e52c50322..8ac84599f2 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -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 |