diff options
author | Eike Ziller <eike.ziller@qt.io> | 2017-01-11 17:04:23 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2017-01-30 10:46:22 +0000 |
commit | 63f66f28ac43c2da3bb278e63ff7c49cde2c1d5c (patch) | |
tree | e185aa5ba917bbc3e20a2dcc8e18bb649abe4d97 /src/libs/utils/algorithm.h | |
parent | b299ff19ecefa2ea91fd4d3697cc1f0b8c67727f (diff) |
Use _t versions of various type traits
Available now after switching to C++14 and GCC>=4.9
Change-Id: I44e9859a6abe66db16d77b228466b65eadced8ae
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'src/libs/utils/algorithm.h')
-rw-r--r-- | src/libs/utils/algorithm.h | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/libs/utils/algorithm.h b/src/libs/utils/algorithm.h index 76645e3311a..909f32a609d 100644 --- a/src/libs/utils/algorithm.h +++ b/src/libs/utils/algorithm.h @@ -207,13 +207,6 @@ inserter(QSet<X> &container) return QSetInsertIterator<QSet<X>>(container); } -// decay_t is C++14, so provide it here, remove once we require C++14 -template<typename T> -using decay_t = typename std::decay<T>::type; - -template<typename T> -using result_of_t = typename std::result_of<T>::type; - // abstraction to treat Container<T> and QStringList similarly template<typename T> struct ContainerType @@ -226,10 +219,10 @@ template<template<typename> class T_Container, typename T_Type> struct ContainerType<T_Container<T_Type>> { template<class F, template<typename> class C = T_Container> - using ResultOfTransform = C<decay_t<result_of_t<F (T_Type)>>>; + using ResultOfTransform = C<std::decay_t<std::result_of_t<F (T_Type)>>>; template<class R> - using ResultOfTransformPMF = T_Container<decay_t<R>>; + using ResultOfTransformPMF = T_Container<std::decay_t<R>>; }; // specialization for QStringList @@ -314,10 +307,10 @@ template<template<typename> class C, // result container type typename S> Q_REQUIRED_RESULT auto transform(const SC &container, R (S::*p)() const) - -> C<decay_t<R>> + -> C<std::decay_t<R>> { return TransformImpl< - C<decay_t<R>>, + C<std::decay_t<R>>, SC >::call(container, p); } |