Title: [223316] trunk/Source/WTF
Revision
223316
Author
commit-qu...@webkit.org
Date
2017-10-13 21:45:20 -0700 (Fri, 13 Oct 2017)

Log Message

Adopt type trait template aliases everywhere in WTF
https://bugs.webkit.org/show_bug.cgi?id=178299

Patch by Sam Weinig <s...@webkit.org> on 2017-10-13
Reviewed by Yusuke Suzuki.

Adopt type trait template aliases (e.g. replace 'typename std::make_unsigned<Source>::type'
with 'std::make_unsigned_t<Source>'). Also adopt using over typedef consistently.

* wtf/Atomics.h:
* wtf/CagedUniquePtr.h:
* wtf/CheckedArithmetic.h:
* wtf/CompletionHandler.h:
* wtf/Function.h:
* wtf/HashCountedSet.h:
* wtf/HashFunctions.h:
* wtf/HashMap.h:
* wtf/HashSet.h:
* wtf/HashTable.h:
* wtf/HashTraits.h:
* wtf/IndexedContainerIterator.h:
* wtf/IteratorAdaptors.h:
* wtf/KeyValuePair.h:
* wtf/LEBDecoder.h:
* wtf/ListHashSet.h:
* wtf/MathExtras.h:
* wtf/NeverDestroyed.h:
* wtf/OptionSet.h:
* wtf/RetainPtr.h:
* wtf/SizeLimits.cpp:
* wtf/StdLibExtras.h:
* wtf/SystemFree.h:
* wtf/ThreadSpecific.h:
* wtf/TypeCasts.h:
* wtf/Vector.h:
* wtf/text/IntegerToStringConversion.h:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (223315 => 223316)


--- trunk/Source/WTF/ChangeLog	2017-10-14 02:38:09 UTC (rev 223315)
+++ trunk/Source/WTF/ChangeLog	2017-10-14 04:45:20 UTC (rev 223316)
@@ -1,3 +1,41 @@
+2017-10-13  Sam Weinig  <s...@webkit.org>
+
+        Adopt type trait template aliases everywhere in WTF
+        https://bugs.webkit.org/show_bug.cgi?id=178299
+
+        Reviewed by Yusuke Suzuki.
+
+        Adopt type trait template aliases (e.g. replace 'typename std::make_unsigned<Source>::type'
+        with 'std::make_unsigned_t<Source>'). Also adopt using over typedef consistently.
+
+        * wtf/Atomics.h:
+        * wtf/CagedUniquePtr.h:
+        * wtf/CheckedArithmetic.h:
+        * wtf/CompletionHandler.h:
+        * wtf/Function.h:
+        * wtf/HashCountedSet.h:
+        * wtf/HashFunctions.h:
+        * wtf/HashMap.h:
+        * wtf/HashSet.h:
+        * wtf/HashTable.h:
+        * wtf/HashTraits.h:
+        * wtf/IndexedContainerIterator.h:
+        * wtf/IteratorAdaptors.h:
+        * wtf/KeyValuePair.h:
+        * wtf/LEBDecoder.h:
+        * wtf/ListHashSet.h:
+        * wtf/MathExtras.h:
+        * wtf/NeverDestroyed.h:
+        * wtf/OptionSet.h:
+        * wtf/RetainPtr.h:
+        * wtf/SizeLimits.cpp:
+        * wtf/StdLibExtras.h:
+        * wtf/SystemFree.h:
+        * wtf/ThreadSpecific.h:
+        * wtf/TypeCasts.h:
+        * wtf/Vector.h:
+        * wtf/text/IntegerToStringConversion.h:
+
 2017-10-13  Jer Noble  <jer.no...@apple.com>
 
         Performance: Skip texture upload if source image and destination texture haven't changed

Modified: trunk/Source/WTF/wtf/Atomics.h (223315 => 223316)


--- trunk/Source/WTF/wtf/Atomics.h	2017-10-14 02:38:09 UTC (rev 223315)
+++ trunk/Source/WTF/wtf/Atomics.h	2017-10-14 04:45:20 UTC (rev 223316)
@@ -346,7 +346,7 @@
     return 0;
 }
 
-template <typename T, typename std::enable_if<sizeof(T) == 8>::type* = nullptr>
+template <typename T, std::enable_if_t<sizeof(T) == 8>* = nullptr>
 ALWAYS_INLINE Dependency dependency(T value)
 {
     unsigned dependency;
@@ -379,7 +379,7 @@
 
 // FIXME: This code is almost identical to the other dependency() overload.
 // https://bugs.webkit.org/show_bug.cgi?id=169405
-template <typename T, typename std::enable_if<sizeof(T) == 4>::type* = nullptr>
+template <typename T, std::enable_if_t<sizeof(T) == 4>* = nullptr>
 ALWAYS_INLINE Dependency dependency(T value)
 {
     unsigned dependency;
@@ -400,13 +400,13 @@
     return dependency;
 }
 
-template <typename T, typename std::enable_if<sizeof(T) == 2>::type* = nullptr>
+template <typename T, std::enable_if_t<sizeof(T) == 2>* = nullptr>
 ALWAYS_INLINE Dependency dependency(T value)
 {
     return dependency(static_cast<uint32_t>(value));
 }
 
-template <typename T, typename std::enable_if<sizeof(T) == 1>::type* = nullptr>
+template <typename T, std::enable_if_t<sizeof(T) == 1>* = nullptr>
 ALWAYS_INLINE Dependency dependency(T value)
 {
     return dependency(static_cast<uint32_t>(value));

Modified: trunk/Source/WTF/wtf/CagedUniquePtr.h (223315 => 223316)


--- trunk/Source/WTF/wtf/CagedUniquePtr.h	2017-10-14 02:38:09 UTC (rev 223315)
+++ trunk/Source/WTF/wtf/CagedUniquePtr.h	2017-10-14 04:45:20 UTC (rev 223316)
@@ -79,7 +79,7 @@
 };
 
 template<Gigacage::Kind kind, typename T>
-class CagedUniquePtr<kind, T[], typename std::enable_if<std::is_trivially_destructible<T>::value>::type> : public CagedPtr<kind, T> {
+class CagedUniquePtr<kind, T[], std::enable_if_t<std::is_trivially_destructible<T>::value>> : public CagedPtr<kind, T> {
 public:
     CagedUniquePtr() : CagedPtr<kind, T>() { }
     
@@ -130,7 +130,7 @@
 };
 
 template<Gigacage::Kind kind, typename T>
-class CagedUniquePtr<kind, T[], typename std::enable_if<!std::is_trivially_destructible<T>::value>::type> : public CagedPtr<kind, T> {
+class CagedUniquePtr<kind, T[], std::enable_if_t<!std::is_trivially_destructible<T>::value>> : public CagedPtr<kind, T> {
 public:
     CagedUniquePtr() : CagedPtr<kind, T>() { }
     

Modified: trunk/Source/WTF/wtf/CheckedArithmetic.h (223315 => 223316)


--- trunk/Source/WTF/wtf/CheckedArithmetic.h	2017-10-14 02:38:09 UTC (rev 223315)
+++ trunk/Source/WTF/wtf/CheckedArithmetic.h	2017-10-14 04:45:20 UTC (rev 223316)
@@ -143,7 +143,7 @@
     {
         // When converting value to unsigned Source, value will become a big value if value is negative.
         // Casted value will become bigger than Target::max as Source is bigger than Target.
-        return static_cast<typename std::make_unsigned<Source>::type>(value) <= std::numeric_limits<Target>::max();
+        return static_cast<std::make_unsigned_t<Source>>(value) <= std::numeric_limits<Target>::max();
     }
 };
 

Modified: trunk/Source/WTF/wtf/CompletionHandler.h (223315 => 223316)


--- trunk/Source/WTF/wtf/CompletionHandler.h	2017-10-14 02:38:09 UTC (rev 223315)
+++ trunk/Source/WTF/wtf/CompletionHandler.h	2017-10-14 04:45:20 UTC (rev 223316)
@@ -37,7 +37,7 @@
 public:
     CompletionHandler() = default;
 
-    template<typename CallableType, class = typename std::enable_if<std::is_rvalue_reference<CallableType&&>::value>::type>
+    template<typename CallableType, class = std::enable_if_t<std::is_rvalue_reference<CallableType&&>::value>>
     CompletionHandler(CallableType&& callable)
         : m_function(WTFMove(callable))
     {

Modified: trunk/Source/WTF/wtf/Function.h (223315 => 223316)


--- trunk/Source/WTF/wtf/Function.h	2017-10-14 02:38:09 UTC (rev 223315)
+++ trunk/Source/WTF/wtf/Function.h	2017-10-14 04:45:20 UTC (rev 223316)
@@ -38,13 +38,13 @@
     Function() = default;
     Function(std::nullptr_t) { }
 
-    template<typename CallableType, class = typename std::enable_if<!(std::is_pointer<CallableType>::value && std::is_function<typename std::remove_pointer<CallableType>::type>::value) && std::is_rvalue_reference<CallableType&&>::value>::type>
+    template<typename CallableType, class = std::enable_if_t<!(std::is_pointer<CallableType>::value && std::is_function<std::remove_pointer_t<CallableType>>::value) && std::is_rvalue_reference<CallableType&&>::value>>
     Function(CallableType&& callable)
         : m_callableWrapper(std::make_unique<CallableWrapper<CallableType>>(WTFMove(callable)))
     {
     }
 
-    template<typename FunctionType, class = typename std::enable_if<std::is_pointer<FunctionType>::value && std::is_function<typename std::remove_pointer<FunctionType>::type>::value>::type>
+    template<typename FunctionType, class = std::enable_if_t<std::is_pointer<FunctionType>::value && std::is_function<std::remove_pointer_t<FunctionType>>::value>>
     Function(FunctionType f)
         : m_callableWrapper(std::make_unique<CallableWrapper<FunctionType>>(WTFMove(f)))
     {
@@ -58,7 +58,7 @@
 
     explicit operator bool() const { return !!m_callableWrapper; }
 
-    template<typename CallableType, class = typename std::enable_if<!(std::is_pointer<CallableType>::value && std::is_function<typename std::remove_pointer<CallableType>::type>::value) && std::is_rvalue_reference<CallableType&&>::value>::type>
+    template<typename CallableType, class = std::enable_if_t<!(std::is_pointer<CallableType>::value && std::is_function<std::remove_pointer_t<CallableType>>::value) && std::is_rvalue_reference<CallableType&&>::value>>
     Function& operator=(CallableType&& callable)
     {
         m_callableWrapper = std::make_unique<CallableWrapper<CallableType>>(WTFMove(callable));
@@ -65,7 +65,7 @@
         return *this;
     }
 
-    template<typename FunctionType, class = typename std::enable_if<std::is_pointer<FunctionType>::value && std::is_function<typename std::remove_pointer<FunctionType>::type>::value>::type>
+    template<typename FunctionType, class = std::enable_if_t<std::is_pointer<FunctionType>::value && std::is_function<std::remove_pointer_t<FunctionType>>::value>>
     Function& operator=(FunctionType f)
     {
         m_callableWrapper = std::make_unique<CallableWrapper<FunctionType>>(WTFMove(f));

Modified: trunk/Source/WTF/wtf/HashCountedSet.h (223315 => 223316)


--- trunk/Source/WTF/wtf/HashCountedSet.h	2017-10-14 02:38:09 UTC (rev 223315)
+++ trunk/Source/WTF/wtf/HashCountedSet.h	2017-10-14 04:45:20 UTC (rev 223316)
@@ -101,11 +101,11 @@
     void clear();
 
     // Overloads for smart pointer keys that take the raw pointer type as the parameter.
-    template<typename V = ValueType> typename std::enable_if<IsSmartPtr<V>::value, iterator>::type find(typename GetPtrHelper<V>::PtrType);
-    template<typename V = ValueType> typename std::enable_if<IsSmartPtr<V>::value, const_iterator>::type find(typename GetPtrHelper<V>::PtrType) const;
-    template<typename V = ValueType> typename std::enable_if<IsSmartPtr<V>::value, bool>::type contains(typename GetPtrHelper<V>::PtrType) const;
-    template<typename V = ValueType> typename std::enable_if<IsSmartPtr<V>::value, unsigned>::type count(typename GetPtrHelper<V>::PtrType) const;
-    template<typename V = ValueType> typename std::enable_if<IsSmartPtr<V>::value, bool>::type remove(typename GetPtrHelper<V>::PtrType);
+    template<typename V = ValueType> std::enable_if_t<IsSmartPtr<V>::value, iterator> find(typename GetPtrHelper<V>::PtrType);
+    template<typename V = ValueType> std::enable_if_t<IsSmartPtr<V>::value, const_iterator> find(typename GetPtrHelper<V>::PtrType) const;
+    template<typename V = ValueType> std::enable_if_t<IsSmartPtr<V>::value, bool> contains(typename GetPtrHelper<V>::PtrType) const;
+    template<typename V = ValueType> std::enable_if_t<IsSmartPtr<V>::value, unsigned> count(typename GetPtrHelper<V>::PtrType) const;
+    template<typename V = ValueType> std::enable_if_t<IsSmartPtr<V>::value, bool> remove(typename GetPtrHelper<V>::PtrType);
 
 private:
     ImplType m_impl;
@@ -276,7 +276,7 @@
 
 template<typename Value, typename HashFunctions, typename Traits>
 template<typename V>
-inline auto HashCountedSet<Value, HashFunctions, Traits>::find(typename GetPtrHelper<V>::PtrType value) -> typename std::enable_if<IsSmartPtr<V>::value, iterator>::type
+inline auto HashCountedSet<Value, HashFunctions, Traits>::find(typename GetPtrHelper<V>::PtrType value) -> std::enable_if_t<IsSmartPtr<V>::value, iterator>
 {
     return m_impl.find(value);
 }
@@ -283,7 +283,7 @@
 
 template<typename Value, typename HashFunctions, typename Traits>
 template<typename V>
-inline auto HashCountedSet<Value, HashFunctions, Traits>::find(typename GetPtrHelper<V>::PtrType value) const -> typename std::enable_if<IsSmartPtr<V>::value, const_iterator>::type
+inline auto HashCountedSet<Value, HashFunctions, Traits>::find(typename GetPtrHelper<V>::PtrType value) const -> std::enable_if_t<IsSmartPtr<V>::value, const_iterator>
 {
     return m_impl.find(value);
 }
@@ -290,7 +290,7 @@
 
 template<typename Value, typename HashFunctions, typename Traits>
 template<typename V>
-inline auto HashCountedSet<Value, HashFunctions, Traits>::contains(typename GetPtrHelper<V>::PtrType value) const -> typename std::enable_if<IsSmartPtr<V>::value, bool>::type
+inline auto HashCountedSet<Value, HashFunctions, Traits>::contains(typename GetPtrHelper<V>::PtrType value) const -> std::enable_if_t<IsSmartPtr<V>::value, bool>
 {
     return m_impl.contains(value);
 }
@@ -297,7 +297,7 @@
 
 template<typename Value, typename HashFunctions, typename Traits>
 template<typename V>
-inline auto HashCountedSet<Value, HashFunctions, Traits>::count(typename GetPtrHelper<V>::PtrType value) const -> typename std::enable_if<IsSmartPtr<V>::value, unsigned>::type
+inline auto HashCountedSet<Value, HashFunctions, Traits>::count(typename GetPtrHelper<V>::PtrType value) const -> std::enable_if_t<IsSmartPtr<V>::value, unsigned>
 {
     return m_impl.get(value);
 }
@@ -304,7 +304,7 @@
 
 template<typename Value, typename HashFunctions, typename Traits>
 template<typename V>
-inline auto HashCountedSet<Value, HashFunctions, Traits>::remove(typename GetPtrHelper<V>::PtrType value) -> typename std::enable_if<IsSmartPtr<V>::value, bool>::type
+inline auto HashCountedSet<Value, HashFunctions, Traits>::remove(typename GetPtrHelper<V>::PtrType value) -> std::enable_if_t<IsSmartPtr<V>::value, bool>
 {
     return remove(find(value));
 }

Modified: trunk/Source/WTF/wtf/HashFunctions.h (223315 => 223316)


--- trunk/Source/WTF/wtf/HashFunctions.h	2017-10-14 02:38:09 UTC (rev 223315)
+++ trunk/Source/WTF/wtf/HashFunctions.h	2017-10-14 04:45:20 UTC (rev 223316)
@@ -178,30 +178,30 @@
     template<typename... Types>
     struct TupleHash {
         template<size_t I = 0>
-        static typename std::enable_if<I < sizeof...(Types) - 1, unsigned>::type hash(const std::tuple<Types...>& t)
+        static std::enable_if_t<I < sizeof...(Types) - 1, unsigned> hash(const std::tuple<Types...>& t)
         {
-            using IthTupleElementType = typename std::tuple_element<I, typename std::tuple<Types...>>::type;
+            using IthTupleElementType = std::tuple_element_t<I, typename std::tuple<Types...>>;
             return pairIntHash(DefaultHash<IthTupleElementType>::Hash::hash(std::get<I>(t)), hash<I + 1>(t));
         }
 
         template<size_t I = 0>
-        static typename std::enable_if<I == sizeof...(Types) - 1, unsigned>::type hash(const std::tuple<Types...>& t)
+        static std::enable_if_t<I == sizeof...(Types) - 1, unsigned> hash(const std::tuple<Types...>& t)
         {
-            using IthTupleElementType = typename std::tuple_element<I, typename std::tuple<Types...>>::type;
+            using IthTupleElementType = std::tuple_element_t<I, typename std::tuple<Types...>>;
             return DefaultHash<IthTupleElementType>::Hash::hash(std::get<I>(t));
         }
 
         template<size_t I = 0>
-        static typename std::enable_if<I < sizeof...(Types) - 1, bool>::type equal(const std::tuple<Types...>& a, const std::tuple<Types...>& b)
+        static std::enable_if_t<I < sizeof...(Types) - 1, bool> equal(const std::tuple<Types...>& a, const std::tuple<Types...>& b)
         {
-            using IthTupleElementType = typename std::tuple_element<I, typename std::tuple<Types...>>::type;
+            using IthTupleElementType = std::tuple_element_t<I, typename std::tuple<Types...>>;
             return DefaultHash<IthTupleElementType>::Hash::equal(std::get<I>(a), std::get<I>(b)) && equal<I + 1>(a, b);
         }
 
         template<size_t I = 0>
-        static typename std::enable_if<I == sizeof...(Types) - 1, bool>::type equal(const std::tuple<Types...>& a, const std::tuple<Types...>& b)
+        static std::enable_if_t<I == sizeof...(Types) - 1, bool> equal(const std::tuple<Types...>& a, const std::tuple<Types...>& b)
         {
-            using IthTupleElementType = typename std::tuple_element<I, typename std::tuple<Types...>>::type;
+            using IthTupleElementType = std::tuple_element_t<I, typename std::tuple<Types...>>;
             return DefaultHash<IthTupleElementType>::Hash::equal(std::get<I>(a), std::get<I>(b));
         }
 

Modified: trunk/Source/WTF/wtf/HashMap.h (223315 => 223316)


--- trunk/Source/WTF/wtf/HashMap.h	2017-10-14 02:38:09 UTC (rev 223315)
+++ trunk/Source/WTF/wtf/HashMap.h	2017-10-14 04:45:20 UTC (rev 223316)
@@ -160,13 +160,13 @@
     template<typename HashTranslator, typename K, typename V> AddResult add(K&&, V&&);
 
     // Overloads for smart pointer keys that take the raw pointer type as the parameter.
-    template<typename K = KeyType> typename std::enable_if<IsSmartPtr<K>::value, iterator>::type find(typename GetPtrHelper<K>::PtrType);
-    template<typename K = KeyType> typename std::enable_if<IsSmartPtr<K>::value, const_iterator>::type find(typename GetPtrHelper<K>::PtrType) const;
-    template<typename K = KeyType> typename std::enable_if<IsSmartPtr<K>::value, bool>::type contains(typename GetPtrHelper<K>::PtrType) const;
-    template<typename K = KeyType> typename std::enable_if<IsSmartPtr<K>::value, MappedPeekType>::type inlineGet(typename GetPtrHelper<K>::PtrType) const;
-    template<typename K = KeyType> typename std::enable_if<IsSmartPtr<K>::value, MappedPeekType>::type get(typename GetPtrHelper<K>::PtrType) const;
-    template<typename K = KeyType> typename std::enable_if<IsSmartPtr<K>::value, bool>::type remove(typename GetPtrHelper<K>::PtrType);
-    template<typename K = KeyType> typename std::enable_if<IsSmartPtr<K>::value, MappedTakeType>::type take(typename GetPtrHelper<K>::PtrType);
+    template<typename K = KeyType> std::enable_if_t<IsSmartPtr<K>::value, iterator> find(typename GetPtrHelper<K>::PtrType);
+    template<typename K = KeyType> std::enable_if_t<IsSmartPtr<K>::value, const_iterator> find(typename GetPtrHelper<K>::PtrType) const;
+    template<typename K = KeyType> std::enable_if_t<IsSmartPtr<K>::value, bool> contains(typename GetPtrHelper<K>::PtrType) const;
+    template<typename K = KeyType> std::enable_if_t<IsSmartPtr<K>::value, MappedPeekType> inlineGet(typename GetPtrHelper<K>::PtrType) const;
+    template<typename K = KeyType> std::enable_if_t<IsSmartPtr<K>::value, MappedPeekType> get(typename GetPtrHelper<K>::PtrType) const;
+    template<typename K = KeyType> std::enable_if_t<IsSmartPtr<K>::value, bool> remove(typename GetPtrHelper<K>::PtrType);
+    template<typename K = KeyType> std::enable_if_t<IsSmartPtr<K>::value, MappedTakeType> take(typename GetPtrHelper<K>::PtrType);
 
     void checkConsistency() const;
 
@@ -473,7 +473,7 @@
 
 template<typename T, typename U, typename V, typename W, typename X>
 template<typename K>
-inline auto HashMap<T, U, V, W, X>::find(typename GetPtrHelper<K>::PtrType key) -> typename std::enable_if<IsSmartPtr<K>::value, iterator>::type
+inline auto HashMap<T, U, V, W, X>::find(typename GetPtrHelper<K>::PtrType key) -> std::enable_if_t<IsSmartPtr<K>::value, iterator>
 {
     return m_impl.template find<HashMapTranslator<KeyValuePairTraits, HashFunctions>>(key);
 }
@@ -480,7 +480,7 @@
 
 template<typename T, typename U, typename V, typename W, typename X>
 template<typename K>
-inline auto HashMap<T, U, V, W, X>::find(typename GetPtrHelper<K>::PtrType key) const -> typename std::enable_if<IsSmartPtr<K>::value, const_iterator>::type
+inline auto HashMap<T, U, V, W, X>::find(typename GetPtrHelper<K>::PtrType key) const -> std::enable_if_t<IsSmartPtr<K>::value, const_iterator>
 {
     return m_impl.template find<HashMapTranslator<KeyValuePairTraits, HashFunctions>>(key);
 }
@@ -487,7 +487,7 @@
 
 template<typename T, typename U, typename V, typename W, typename X>
 template<typename K>
-inline auto HashMap<T, U, V, W, X>::contains(typename GetPtrHelper<K>::PtrType key) const -> typename std::enable_if<IsSmartPtr<K>::value, bool>::type
+inline auto HashMap<T, U, V, W, X>::contains(typename GetPtrHelper<K>::PtrType key) const -> std::enable_if_t<IsSmartPtr<K>::value, bool>
 {
     return m_impl.template contains<HashMapTranslator<KeyValuePairTraits, HashFunctions>>(key);
 }
@@ -494,7 +494,7 @@
 
 template<typename T, typename U, typename V, typename W, typename X>
 template<typename K>
-inline auto HashMap<T, U, V, W, X>::inlineGet(typename GetPtrHelper<K>::PtrType key) const -> typename std::enable_if<IsSmartPtr<K>::value, MappedPeekType>::type
+inline auto HashMap<T, U, V, W, X>::inlineGet(typename GetPtrHelper<K>::PtrType key) const -> std::enable_if_t<IsSmartPtr<K>::value, MappedPeekType>
 {
     KeyValuePairType* entry = const_cast<HashTableType&>(m_impl).template inlineLookup<HashMapTranslator<KeyValuePairTraits, HashFunctions>>(key);
     if (!entry)
@@ -504,7 +504,7 @@
 
 template<typename T, typename U, typename V, typename W, typename X>
 template<typename K>
-auto HashMap<T, U, V, W, X>::get(typename GetPtrHelper<K>::PtrType key) const -> typename std::enable_if<IsSmartPtr<K>::value, MappedPeekType>::type
+auto HashMap<T, U, V, W, X>::get(typename GetPtrHelper<K>::PtrType key) const -> std::enable_if_t<IsSmartPtr<K>::value, MappedPeekType>
 {
     return inlineGet(key);
 }
@@ -511,7 +511,7 @@
 
 template<typename T, typename U, typename V, typename W, typename X>
 template<typename K>
-inline auto HashMap<T, U, V, W, X>::remove(typename GetPtrHelper<K>::PtrType key) -> typename std::enable_if<IsSmartPtr<K>::value, bool>::type
+inline auto HashMap<T, U, V, W, X>::remove(typename GetPtrHelper<K>::PtrType key) -> std::enable_if_t<IsSmartPtr<K>::value, bool>
 {
     return remove(find(key));
 }
@@ -518,7 +518,7 @@
 
 template<typename T, typename U, typename V, typename W, typename X>
 template<typename K>
-inline auto HashMap<T, U, V, W, X>::take(typename GetPtrHelper<K>::PtrType key) -> typename std::enable_if<IsSmartPtr<K>::value, MappedTakeType>::type
+inline auto HashMap<T, U, V, W, X>::take(typename GetPtrHelper<K>::PtrType key) -> std::enable_if_t<IsSmartPtr<K>::value, MappedTakeType>
 {
     iterator it = find(key);
     if (it == end())

Modified: trunk/Source/WTF/wtf/HashSet.h (223315 => 223316)


--- trunk/Source/WTF/wtf/HashSet.h	2017-10-14 02:38:09 UTC (rev 223315)
+++ trunk/Source/WTF/wtf/HashSet.h	2017-10-14 04:45:20 UTC (rev 223316)
@@ -34,21 +34,20 @@
 class HashSet final {
     WTF_MAKE_FAST_ALLOCATED;
 private:
-    typedef HashArg HashFunctions;
-    typedef TraitsArg ValueTraits;
-    typedef typename ValueTraits::TakeType TakeType;
+    using HashFunctions = HashArg;
+    using ValueTraits = TraitsArg;
+    using TakeType = typename ValueTraits::TakeType;
 
 public:
-    typedef typename ValueTraits::TraitType ValueType;
+    using ValueType = typename ValueTraits::TraitType;
 
 private:
-    typedef HashTable<ValueType, ValueType, IdentityExtractor,
-        HashFunctions, ValueTraits, ValueTraits> HashTableType;
+    using HashTableType = HashTable<ValueType, ValueType, IdentityExtractor, HashFunctions, ValueTraits, ValueTraits>;
 
 public:
-    typedef HashTableConstIteratorAdapter<HashTableType, ValueType> iterator;
-    typedef HashTableConstIteratorAdapter<HashTableType, ValueType> const_iterator;
-    typedef typename HashTableType::AddResult AddResult;
+    using iterator = HashTableConstIteratorAdapter<HashTableType, ValueType>;
+    using const_iterator = HashTableConstIteratorAdapter<HashTableType, ValueType>;
+    using AddResult= typename HashTableType::AddResult;
 
     HashSet()
     {
@@ -113,10 +112,10 @@
     TakeType takeAny();
 
     // Overloads for smart pointer values that take the raw pointer type as the parameter.
-    template<typename V = ValueType> typename std::enable_if<IsSmartPtr<V>::value, iterator>::type find(typename GetPtrHelper<V>::PtrType) const;
-    template<typename V = ValueType> typename std::enable_if<IsSmartPtr<V>::value, bool>::type contains(typename GetPtrHelper<V>::PtrType) const;
-    template<typename V = ValueType> typename std::enable_if<IsSmartPtr<V>::value, bool>::type remove(typename GetPtrHelper<V>::PtrType);
-    template<typename V = ValueType> typename std::enable_if<IsSmartPtr<V>::value, TakeType>::type take(typename GetPtrHelper<V>::PtrType);
+    template<typename V = ValueType> std::enable_if_t<IsSmartPtr<V>::value, iterator> find(typename GetPtrHelper<V>::PtrType) const;
+    template<typename V = ValueType> std::enable_if_t<IsSmartPtr<V>::value, bool> contains(typename GetPtrHelper<V>::PtrType) const;
+    template<typename V = ValueType> std::enable_if_t<IsSmartPtr<V>::value, bool> remove(typename GetPtrHelper<V>::PtrType);
+    template<typename V = ValueType> std::enable_if_t<IsSmartPtr<V>::value, TakeType> take(typename GetPtrHelper<V>::PtrType);
 
     static bool isValidValue(const ValueType&);
 
@@ -311,7 +310,7 @@
 
 template<typename Value, typename HashFunctions, typename Traits>
 template<typename V>
-inline auto HashSet<Value, HashFunctions, Traits>::find(typename GetPtrHelper<V>::PtrType value) const -> typename std::enable_if<IsSmartPtr<V>::value, iterator>::type
+inline auto HashSet<Value, HashFunctions, Traits>::find(typename GetPtrHelper<V>::PtrType value) const -> std::enable_if_t<IsSmartPtr<V>::value, iterator>
 {
     return m_impl.template find<HashSetTranslator<Traits, HashFunctions>>(value);
 }
@@ -318,7 +317,7 @@
 
 template<typename Value, typename HashFunctions, typename Traits>
 template<typename V>
-inline auto HashSet<Value, HashFunctions, Traits>::contains(typename GetPtrHelper<V>::PtrType value) const -> typename std::enable_if<IsSmartPtr<V>::value, bool>::type
+inline auto HashSet<Value, HashFunctions, Traits>::contains(typename GetPtrHelper<V>::PtrType value) const -> std::enable_if_t<IsSmartPtr<V>::value, bool>
 {
     return m_impl.template contains<HashSetTranslator<Traits, HashFunctions>>(value);
 }
@@ -325,7 +324,7 @@
 
 template<typename Value, typename HashFunctions, typename Traits>
 template<typename V>
-inline auto HashSet<Value, HashFunctions, Traits>::remove(typename GetPtrHelper<V>::PtrType value) -> typename std::enable_if<IsSmartPtr<V>::value, bool>::type
+inline auto HashSet<Value, HashFunctions, Traits>::remove(typename GetPtrHelper<V>::PtrType value) -> std::enable_if_t<IsSmartPtr<V>::value, bool>
 {
     return remove(find(value));
 }
@@ -332,7 +331,7 @@
 
 template<typename Value, typename HashFunctions, typename Traits>
 template<typename V>
-inline auto HashSet<Value, HashFunctions, Traits>::take(typename GetPtrHelper<V>::PtrType value) -> typename std::enable_if<IsSmartPtr<V>::value, TakeType>::type
+inline auto HashSet<Value, HashFunctions, Traits>::take(typename GetPtrHelper<V>::PtrType value) -> std::enable_if_t<IsSmartPtr<V>::value, TakeType>
 {
     return take(find(value));
 }

Modified: trunk/Source/WTF/wtf/HashTable.h (223315 => 223316)


--- trunk/Source/WTF/wtf/HashTable.h	2017-10-14 02:38:09 UTC (rev 223315)
+++ trunk/Source/WTF/wtf/HashTable.h	2017-10-14 04:45:20 UTC (rev 223316)
@@ -105,12 +105,12 @@
     template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits>
     class HashTableConstIterator : public std::iterator<std::forward_iterator_tag, Value, std::ptrdiff_t, const Value*, const Value&> {
     private:
-        typedef HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits> HashTableType;
-        typedef HashTableIterator<Key, Value, Extractor, HashFunctions, Traits, KeyTraits> iterator;
-        typedef HashTableConstIterator<Key, Value, Extractor, HashFunctions, Traits, KeyTraits> const_iterator;
-        typedef Value ValueType;
-        typedef const ValueType& ReferenceType;
-        typedef const ValueType* PointerType;
+        using HashTableType = HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>;
+        using iterator = HashTableIterator<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>;
+        using const_iterator = HashTableConstIterator<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>;
+        using ValueType = Value;
+        using ReferenceType = const ValueType&;
+        using PointerType = const ValueType*;
 
         friend class HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>;
         friend class HashTableIterator<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>;
@@ -241,12 +241,12 @@
     template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits>
     class HashTableIterator : public std::iterator<std::forward_iterator_tag, Value, std::ptrdiff_t, Value*, Value&> {
     private:
-        typedef HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits> HashTableType;
-        typedef HashTableIterator<Key, Value, Extractor, HashFunctions, Traits, KeyTraits> iterator;
-        typedef HashTableConstIterator<Key, Value, Extractor, HashFunctions, Traits, KeyTraits> const_iterator;
-        typedef Value ValueType;
-        typedef ValueType& ReferenceType;
-        typedef ValueType* PointerType;
+        using HashTableType = HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>;
+        using iterator = HashTableIterator<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>;
+        using const_iterator = HashTableConstIterator<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>;
+        using ValueType = Value;
+        using ReferenceType = ValueType&;
+        using PointerType = ValueType*;
 
         friend class HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>;
 
@@ -300,13 +300,13 @@
     template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits>
     class HashTable {
     public:
-        typedef HashTableIterator<Key, Value, Extractor, HashFunctions, Traits, KeyTraits> iterator;
-        typedef HashTableConstIterator<Key, Value, Extractor, HashFunctions, Traits, KeyTraits> const_iterator;
-        typedef Traits ValueTraits;
-        typedef Key KeyType;
-        typedef Value ValueType;
-        typedef IdentityHashTranslator<ValueTraits, HashFunctions> IdentityTranslatorType;
-        typedef HashTableAddResult<iterator> AddResult;
+        using iterator = HashTableIterator<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>;
+        using const_iterator = HashTableConstIterator<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>;
+        using ValueTraits = Traits;
+        using KeyType = Key;
+        using ValueType = Value;
+        using IdentityTranslatorType = IdentityHashTranslator<ValueTraits, HashFunctions>;
+        using AddResult = HashTableAddResult<iterator>;
 
 #if DUMP_HASHTABLE_STATS_PER_TABLE
         struct Stats {
@@ -433,8 +433,8 @@
         static ValueType* allocateTable(unsigned size);
         static void deallocateTable(ValueType* table, unsigned size);
 
-        typedef std::pair<ValueType*, bool> LookupType;
-        typedef std::pair<LookupType, unsigned> FullLookupType;
+        using LookupType = std::pair<ValueType*, bool>;
+        using FullLookupType = std::pair<LookupType, unsigned>;
 
         LookupType lookupForWriting(const Key& key) { return lookupForWriting<IdentityTranslatorType>(key); };
         template<typename HashTranslator, typename T> FullLookupType fullLookupForWriting(const T&);
@@ -585,7 +585,7 @@
         if (!HashFunctions::safeToCompareToEmptyOrDeleted)
             return;
         ASSERT(!HashTranslator::equal(KeyTraits::emptyValue(), key));
-        typename std::aligned_storage<sizeof(ValueType), std::alignment_of<ValueType>::value>::type deletedValueBuffer;
+        std::aligned_storage_t<sizeof(ValueType), std::alignment_of<ValueType>::value> deletedValueBuffer;
         ValueType* deletedValuePtr = reinterpret_cast_ptr<ValueType*>(&deletedValueBuffer);
         ValueType& deletedValue = *deletedValuePtr;
         Traits::constructDeletedValue(deletedValue);

Modified: trunk/Source/WTF/wtf/HashTraits.h (223315 => 223316)


--- trunk/Source/WTF/wtf/HashTraits.h	2017-10-14 02:38:09 UTC (rev 223315)
+++ trunk/Source/WTF/wtf/HashTraits.h	2017-10-14 04:45:20 UTC (rev 223316)
@@ -105,7 +105,7 @@
 
 // Can be used with strong enums, allows zero as key.
 template<typename T> struct StrongEnumHashTraits : GenericHashTraits<T> {
-    using UnderlyingType = typename std::underlying_type<T>::type;
+    using UnderlyingType = std::underlying_type_t<T>;
     static const bool emptyValueIsZero = false;
     static T emptyValue() { return static_cast<T>(std::numeric_limits<UnderlyingType>::max()); }
     static void constructDeletedValue(T& slot) { slot = static_cast<T>(std::numeric_limits<UnderlyingType>::max() - 1); }
@@ -224,15 +224,13 @@
 };
 
 template<typename Traits, typename T>
-typename std::enable_if<HashTraitHasCustomDelete<Traits, T>::value>::type
-hashTraitsDeleteBucket(T& value)
+auto hashTraitsDeleteBucket(T& value) -> std::enable_if_t<HashTraitHasCustomDelete<Traits, T>::value>
 {
     Traits::customDeleteBucket(value);
 }
 
 template<typename Traits, typename T>
-typename std::enable_if<!HashTraitHasCustomDelete<Traits, T>::value>::type
-hashTraitsDeleteBucket(T& value)
+auto hashTraitsDeleteBucket(T& value) -> std::enable_if_t<!HashTraitHasCustomDelete<Traits, T>::value>
 {
     value.~T();
     Traits::constructDeletedValue(value);

Modified: trunk/Source/WTF/wtf/IndexedContainerIterator.h (223315 => 223316)


--- trunk/Source/WTF/wtf/IndexedContainerIterator.h	2017-10-14 02:38:09 UTC (rev 223315)
+++ trunk/Source/WTF/wtf/IndexedContainerIterator.h	2017-10-14 04:45:20 UTC (rev 223316)
@@ -44,7 +44,7 @@
     {
     }
 
-    auto operator*() -> typename std::result_of<decltype(&Container::at)(const Container, unsigned)>::type
+    auto operator*() -> std::result_of_t<decltype(&Container::at)(const Container, unsigned)>
     {
         return m_container->at(m_index);
     }

Modified: trunk/Source/WTF/wtf/IteratorAdaptors.h (223315 => 223316)


--- trunk/Source/WTF/wtf/IteratorAdaptors.h	2017-10-14 02:38:09 UTC (rev 223315)
+++ trunk/Source/WTF/wtf/IteratorAdaptors.h	2017-10-14 04:45:20 UTC (rev 223316)
@@ -52,7 +52,7 @@
         return *this;
     }
 
-    const typename std::remove_const<decltype(*std::declval<Iterator>())>::type operator*() const
+    const std::remove_const_t<decltype(*std::declval<Iterator>())> operator*() const
     {
         ASSERT(m_iter != m_end);
         ASSERT(m_pred(*m_iter));
@@ -89,7 +89,7 @@
         return *this;
     }
 
-    const typename std::remove_const<decltype(std::declval<Transform>()(*std::declval<Iterator>()))>::type operator*() const
+    const std::remove_const_t<decltype(std::declval<Transform>()(*std::declval<Iterator>()))> operator*() const
     {
         return m_transform(*m_iter);
     }

Modified: trunk/Source/WTF/wtf/KeyValuePair.h (223315 => 223316)


--- trunk/Source/WTF/wtf/KeyValuePair.h	2017-10-14 02:38:09 UTC (rev 223315)
+++ trunk/Source/WTF/wtf/KeyValuePair.h	2017-10-14 04:45:20 UTC (rev 223316)
@@ -57,9 +57,9 @@
 };
 
 template<typename K, typename V>
-inline KeyValuePair<typename std::decay<K>::type, typename std::decay<V>::type> makeKeyValuePair(K&& key, V&& value)
+inline KeyValuePair<std::decay_t<K>, std::decay_t<V>> makeKeyValuePair(K&& key, V&& value)
 {
-    return KeyValuePair<typename std::decay<K>::type, typename std::decay<V>::type> { std::forward<K>(key), std::forward<V>(value) };
+    return KeyValuePair<std::decay_t<K>, std::decay_t<V>> { std::forward<K>(key), std::forward<V>(value) };
 }
 
 }

Modified: trunk/Source/WTF/wtf/LEBDecoder.h (223315 => 223316)


--- trunk/Source/WTF/wtf/LEBDecoder.h	2017-10-14 02:38:09 UTC (rev 223315)
+++ trunk/Source/WTF/wtf/LEBDecoder.h	2017-10-14 04:45:20 UTC (rev 223316)
@@ -79,7 +79,7 @@
             return false;
     }
 
-    using UnsignedT = typename std::make_unsigned<T>::type;
+    using UnsignedT = std::make_unsigned_t<T>;
     if (shift < numBits && (byte & 0x40))
         result = static_cast<T>(static_cast<UnsignedT>(result) | (static_cast<UnsignedT>(-1) << shift));
     return true;

Modified: trunk/Source/WTF/wtf/ListHashSet.h (223315 => 223316)


--- trunk/Source/WTF/wtf/ListHashSet.h	2017-10-14 02:38:09 UTC (rev 223315)
+++ trunk/Source/WTF/wtf/ListHashSet.h	2017-10-14 04:45:20 UTC (rev 223316)
@@ -48,25 +48,25 @@
 template<typename ValueArg, typename HashArg = typename DefaultHash<ValueArg>::Hash> class ListHashSet {
     WTF_MAKE_FAST_ALLOCATED;
 private:
-    typedef ListHashSetNode<ValueArg> Node;
+    using Node = ListHashSetNode<ValueArg>;
 
-    typedef HashTraits<Node*> NodeTraits;
-    typedef ListHashSetNodeHashFunctions<HashArg> NodeHash;
-    typedef ListHashSetTranslator<HashArg> BaseTranslator;
+    using NodeTraits = HashTraits<Node*>;
+    using NodeHash = ListHashSetNodeHashFunctions<HashArg>;
+    using BaseTranslator = ListHashSetTranslator<HashArg>;
 
-    typedef HashArg HashFunctions;
+    using HashFunctions = HashArg;
 
 public:
-    typedef ValueArg ValueType;
+    using ValueType = ValueArg;
 
-    typedef ListHashSetIterator<ValueType, HashArg> iterator;
-    typedef ListHashSetConstIterator<ValueType, HashArg> const_iterator;
+    using iterator = ListHashSetIterator<ValueType, HashArg>;
+    using const_iterator = ListHashSetConstIterator<ValueType, HashArg>;
     friend class ListHashSetConstIterator<ValueType, HashArg>;
 
-    typedef std::reverse_iterator<iterator> reverse_iterator;
-    typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+    using reverse_iterator = std::reverse_iterator<iterator>;
+    using const_reverse_iterator = std::reverse_iterator<const_iterator>;
 
-    typedef HashTableAddResult<iterator> AddResult;
+    using AddResult = HashTableAddResult<iterator>;
 
     ListHashSet() = default;
     ListHashSet(std::initializer_list<ValueType>);
@@ -177,11 +177,11 @@
 
 template<typename ValueArg, typename HashArg> class ListHashSetIterator {
 private:
-    typedef ListHashSet<ValueArg, HashArg> ListHashSetType;
-    typedef ListHashSetIterator<ValueArg, HashArg> iterator;
-    typedef ListHashSetConstIterator<ValueArg, HashArg> const_iterator;
-    typedef ListHashSetNode<ValueArg> Node;
-    typedef ValueArg ValueType;
+    using ListHashSetType = ListHashSet<ValueArg, HashArg>;
+    using iterator = ListHashSetIterator<ValueArg, HashArg>;
+    using const_iterator = ListHashSetConstIterator<ValueArg, HashArg>;
+    using Node = ListHashSetNode<ValueArg>;
+    using ValueType = ValueArg;
 
     friend class ListHashSet<ValueArg, HashArg>;
 
@@ -188,11 +188,11 @@
     ListHashSetIterator(const ListHashSetType* set, Node* position) : m_iterator(set, position) { }
 
 public:
-    typedef ptrdiff_t difference_type;
-    typedef ValueType value_type;
-    typedef ValueType* pointer;
-    typedef ValueType& reference;
-    typedef std::bidirectional_iterator_tag iterator_category;
+    using difference_type = ptrdiff_t;
+    using value_type = ValueType;
+    using pointer = ValueType*;
+    using reference = ValueType&;
+    using iterator_category = std::bidirectional_iterator_tag;
 
     ListHashSetIterator() { }
 
@@ -224,11 +224,11 @@
 
 template<typename ValueArg, typename HashArg> class ListHashSetConstIterator {
 private:
-    typedef ListHashSet<ValueArg, HashArg> ListHashSetType;
-    typedef ListHashSetIterator<ValueArg, HashArg> iterator;
-    typedef ListHashSetConstIterator<ValueArg, HashArg> const_iterator;
-    typedef ListHashSetNode<ValueArg> Node;
-    typedef ValueArg ValueType;
+    using ListHashSetType = ListHashSet<ValueArg, HashArg>;
+    using iterator = ListHashSetIterator<ValueArg, HashArg>;
+    using const_iterator = ListHashSetConstIterator<ValueArg, HashArg>;
+    using Node = ListHashSetNode<ValueArg>;
+    using ValueType = ValueArg;
 
     friend class ListHashSet<ValueArg, HashArg>;
     friend class ListHashSetIterator<ValueArg, HashArg>;
@@ -240,11 +240,11 @@
     }
 
 public:
-    typedef ptrdiff_t difference_type;
-    typedef const ValueType value_type;
-    typedef const ValueType* pointer;
-    typedef const ValueType& reference;
-    typedef std::bidirectional_iterator_tag iterator_category;
+    using difference_type = ptrdiff_t;
+    using value_type = const ValueType;
+    using pointer = const ValueType*;
+    using reference = const ValueType&;
+    using iterator_category = std::bidirectional_iterator_tag;
 
     ListHashSetConstIterator()
     {

Modified: trunk/Source/WTF/wtf/MathExtras.h (223315 => 223316)


--- trunk/Source/WTF/wtf/MathExtras.h	2017-10-14 02:38:09 UTC (rev 223315)
+++ trunk/Source/WTF/wtf/MathExtras.h	2017-10-14 04:45:20 UTC (rev 223316)
@@ -209,7 +209,7 @@
 
 template <typename T> inline unsigned getLSBSet(T value)
 {
-    typedef typename std::make_unsigned<T>::type UnsignedT;
+    typedef std::make_unsigned_t<T> UnsignedT;
     unsigned result = 0;
 
     UnsignedT unsignedValue = static_cast<UnsignedT>(value);
@@ -373,7 +373,7 @@
 }
 
 template <typename T>
-inline typename std::enable_if<std::is_floating_point<T>::value, T>::type safeFPDivision(T u, T v)
+inline std::enable_if_t<std::is_floating_point<T>::value, T> safeFPDivision(T u, T v)
 {
     // Protect against overflow / underflow.
     if (v < 1 && u > v * std::numeric_limits<T>::max())
@@ -390,7 +390,7 @@
 //     Boston: Addison-Wesley, 1998. 229-45.
 // [2] http://www.boost.org/doc/libs/1_34_0/libs/test/doc/components/test_tools/floating_point_comparison.html
 template <typename T>
-inline typename std::enable_if<std::is_floating_point<T>::value, bool>::type areEssentiallyEqual(T u, T v, T epsilon = std::numeric_limits<T>::epsilon())
+inline std::enable_if_t<std::is_floating_point<T>::value, bool> areEssentiallyEqual(T u, T v, T epsilon = std::numeric_limits<T>::epsilon())
 {
     if (u == v)
         return true;
@@ -401,7 +401,7 @@
 
 // Match behavior of Math.min, where NaN is returned if either argument is NaN.
 template <typename T>
-inline typename std::enable_if<std::is_floating_point<T>::value, T>::type nanPropagatingMin(T a, T b)
+inline std::enable_if_t<std::is_floating_point<T>::value, T> nanPropagatingMin(T a, T b)
 {
     return std::isnan(a) || std::isnan(b) ? std::numeric_limits<T>::quiet_NaN() : std::min(a, b);
 }
@@ -408,7 +408,7 @@
 
 // Match behavior of Math.max, where NaN is returned if either argument is NaN.
 template <typename T>
-inline typename std::enable_if<std::is_floating_point<T>::value, T>::type nanPropagatingMax(T a, T b)
+inline std::enable_if_t<std::is_floating_point<T>::value, T> nanPropagatingMax(T a, T b)
 {
     return std::isnan(a) || std::isnan(b) ? std::numeric_limits<T>::quiet_NaN() : std::max(a, b);
 }

Modified: trunk/Source/WTF/wtf/NeverDestroyed.h (223315 => 223316)


--- trunk/Source/WTF/wtf/NeverDestroyed.h	2017-10-14 02:38:09 UTC (rev 223315)
+++ trunk/Source/WTF/wtf/NeverDestroyed.h	2017-10-14 04:45:20 UTC (rev 223316)
@@ -62,13 +62,13 @@
     const T& get() const { return *storagePointer(); }
 
 private:
-    using PointerType = typename std::remove_const<T>::type*;
+    using PointerType = std::remove_const_t<T>*;
 
     PointerType storagePointer() const { return const_cast<PointerType>(reinterpret_cast<const T*>(&m_storage)); }
 
     // FIXME: Investigate whether we should allocate a hunk of virtual memory
     // and hand out chunks of it to NeverDestroyed instead, to reduce fragmentation.
-    typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::type m_storage;
+    std::aligned_storage_t<sizeof(T), std::alignment_of<T>::value> m_storage;
 
     template<typename PtrType, bool ShouldRelax = std::is_base_of<RefCountedBase, PtrType>::value> struct MaybeRelax {
         explicit MaybeRelax(PtrType*) { }
@@ -116,7 +116,7 @@
 #endif
 
 private:
-    using PointerType = typename std::remove_const<T>::type*;
+    using PointerType = std::remove_const_t<T>*;
 
     PointerType storagePointer() const
     {
@@ -126,7 +126,7 @@
 
     // FIXME: Investigate whether we should allocate a hunk of virtual memory
     // and hand out chunks of it to NeverDestroyed instead, to reduce fragmentation.
-    typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::type m_storage;
+    std::aligned_storage_t<sizeof(T), std::alignment_of<T>::value> m_storage;
 
     template<typename PtrType, bool ShouldRelax = std::is_base_of<RefCountedBase, PtrType>::value> struct MaybeRelax {
         explicit MaybeRelax(PtrType*) { }

Modified: trunk/Source/WTF/wtf/OptionSet.h (223315 => 223316)


--- trunk/Source/WTF/wtf/OptionSet.h	2017-10-14 02:38:09 UTC (rev 223315)
+++ trunk/Source/WTF/wtf/OptionSet.h	2017-10-14 04:45:20 UTC (rev 223316)
@@ -38,7 +38,7 @@
 // enumerators around.
 template<typename T> class OptionSet {
     static_assert(std::is_enum<T>::value, "T is not an enum type");
-    typedef typename std::make_unsigned<typename std::underlying_type<T>::type>::type StorageType;
+    using StorageType = std::make_unsigned_t<std::underlying_type_t<T>>;
 
 public:
     template<typename StorageType> class Iterator {

Modified: trunk/Source/WTF/wtf/RetainPtr.h (223315 => 223316)


--- trunk/Source/WTF/wtf/RetainPtr.h	2017-10-14 02:38:09 UTC (rev 223315)
+++ trunk/Source/WTF/wtf/RetainPtr.h	2017-10-14 04:45:20 UTC (rev 223316)
@@ -57,7 +57,7 @@
 
 template<typename T> class RetainPtr {
 public:
-    typedef typename std::remove_pointer<T>::type ValueType;
+    typedef std::remove_pointer_t<T> ValueType;
     typedef ValueType* PtrType;
     typedef CFTypeRef StorageType;
 
@@ -113,15 +113,13 @@
 
 #if defined (__OBJC__) && __has_feature(objc_arc)
     template<typename U>
-    typename std::enable_if<std::is_convertible<U, id>::value, PtrType>::type
-    fromStorageTypeHelper(StorageType ptr) const
+    auto fromStorageTypeHelper(StorageType ptr) const -> std::enable_if_t<std::is_convertible<U, id>::value, PtrType>
     {
         return (__bridge PtrType)ptr;
     }
 
     template<typename U>
-    typename std::enable_if<!std::is_convertible<U, id>::value, PtrType>::type
-    fromStorageTypeHelper(StorageType ptr) const
+    auto fromStorageTypeHelper(StorageType ptr) const -> std::enable_if_t<!std::is_convertible<U, id>::value, PtrType>
     {
         return (PtrType)ptr;
     }

Modified: trunk/Source/WTF/wtf/SizeLimits.cpp (223315 => 223316)


--- trunk/Source/WTF/wtf/SizeLimits.cpp	2017-10-14 02:38:09 UTC (rev 223315)
+++ trunk/Source/WTF/wtf/SizeLimits.cpp	2017-10-14 04:45:20 UTC (rev 223316)
@@ -70,7 +70,7 @@
 template<typename T, unsigned inlineCapacity>
 struct SameSizeAsVectorWithInlineCapacity {
     SameSizeAsVectorWithInlineCapacity<T, 0> baseCapacity;
-    typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::type inlineBuffer[inlineCapacity];
+    std::aligned_storage_t<sizeof(T), std::alignment_of<T>::value> inlineBuffer[inlineCapacity];
 };
 
 static_assert(sizeof(Vector<int>) == sizeof(SameSizeAsVectorWithInlineCapacity<int>), "Vector should stay small!");

Modified: trunk/Source/WTF/wtf/StdLibExtras.h (223315 => 223316)


--- trunk/Source/WTF/wtf/StdLibExtras.h	2017-10-14 02:38:09 UTC (rev 223315)
+++ trunk/Source/WTF/wtf/StdLibExtras.h	2017-10-14 04:45:20 UTC (rev 223316)
@@ -148,7 +148,7 @@
     static_assert(__is_trivially_copyable(ToType), "bitwise_cast of non-trivially-copyable type!");
     static_assert(__is_trivially_copyable(FromType), "bitwise_cast of non-trivially-copyable type!");
 #endif
-    typename std::remove_const<ToType>::type to { };
+    std::remove_const_t<ToType> to { };
     std::memcpy(&to, &from, sizeof(to));
     return to;
 }
@@ -402,7 +402,7 @@
         static std::true_type test(Base<Args...>*);
         static std::false_type test(void*);
 
-        static constexpr const bool value = decltype(test(std::declval<typename std::remove_cv<Derived>::type*>()))::value;
+        static constexpr const bool value = decltype(test(std::declval<std::remove_cv_t<Derived>*>()))::value;
     };
 }
 
@@ -411,7 +411,7 @@
 
 template <class T>
 struct RemoveCVAndReference  {
-    typedef typename std::remove_cv<typename std::remove_reference<T>::type>::type type;
+    typedef std::remove_cv_t<std::remove_reference_t<T>> type;
 };
 
 template<typename IteratorTypeLeft, typename IteratorTypeRight, typename IteratorTypeDst>
@@ -487,7 +487,7 @@
 template<class T> inline typename _Unique_if<T>::_Unknown_bound
 make_unique(size_t n)
 {
-    typedef typename remove_extent<T>::type U;
+    typedef remove_extent_t<T> U;
     return unique_ptr<T>(new U[n]());
 }
 
@@ -506,11 +506,11 @@
 #endif
 
 template<WTF::CheckMoveParameterTag, typename T>
-ALWAYS_INLINE constexpr typename remove_reference<T>::type&& move(T&& value)
+ALWAYS_INLINE constexpr remove_reference_t<T>&& move(T&& value)
 {
     static_assert(is_lvalue_reference<T>::value, "T is not an lvalue reference; move() is unnecessary.");
 
-    using NonRefQualifiedType = typename remove_reference<T>::type;
+    using NonRefQualifiedType = remove_reference_t<T>;
     static_assert(!is_const<NonRefQualifiedType>::value, "T is const qualified.");
 
     return move(forward<T>(value));

Modified: trunk/Source/WTF/wtf/SystemFree.h (223315 => 223316)


--- trunk/Source/WTF/wtf/SystemFree.h	2017-10-14 02:38:09 UTC (rev 223315)
+++ trunk/Source/WTF/wtf/SystemFree.h	2017-10-14 04:45:20 UTC (rev 223316)
@@ -33,7 +33,7 @@
 struct SystemFree {
     void operator()(T* pointer) const
     {
-        free(const_cast<typename std::remove_cv<T>::type*>(pointer));
+        free(const_cast<std::remove_cv_t<T>*>(pointer));
     }
 };
 
@@ -41,7 +41,7 @@
 struct SystemFree<T[]> {
     void operator()(T* pointer) const
     {
-        free(const_cast<typename std::remove_cv<T>::type*>(pointer));
+        free(const_cast<std::remove_cv_t<T>*>(pointer));
     }
 
 };

Modified: trunk/Source/WTF/wtf/ThreadSpecific.h (223315 => 223316)


--- trunk/Source/WTF/wtf/ThreadSpecific.h	2017-10-14 02:38:09 UTC (rev 223315)
+++ trunk/Source/WTF/wtf/ThreadSpecific.h	2017-10-14 04:45:20 UTC (rev 223316)
@@ -93,7 +93,7 @@
         WTF_MAKE_NONCOPYABLE(Data);
         WTF_MAKE_FAST_ALLOCATED;
     public:
-        using PointerType = typename std::remove_const<T>::type*;
+        using PointerType = std::remove_const_t<T>*;
 
         Data(ThreadSpecific<T, canBeGCThread>* owner)
             : owner(owner)
@@ -112,7 +112,7 @@
 
         PointerType storagePointer() const { return const_cast<PointerType>(reinterpret_cast<const T*>(&m_storage)); }
 
-        typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::type m_storage;
+        std::aligned_storage_t<sizeof(T), std::alignment_of<T>::value> m_storage;
         ThreadSpecific<T, canBeGCThread>* owner;
     };
 

Modified: trunk/Source/WTF/wtf/TypeCasts.h (223315 => 223316)


--- trunk/Source/WTF/wtf/TypeCasts.h	2017-10-14 02:38:09 UTC (rev 223315)
+++ trunk/Source/WTF/wtf/TypeCasts.h	2017-10-14 04:45:20 UTC (rev 223316)
@@ -69,25 +69,27 @@
 // Update T's constness to match Reference's.
 template <typename Reference, typename T>
 struct match_constness {
-    typedef typename std::conditional<std::is_const<Reference>::value, typename std::add_const<T>::type, typename std::remove_const<T>::type>::type type;
+    typedef std::conditional_t<std::is_const<Reference>::value, std::add_const_t<T>, std::remove_const_t<T>> type;
 };
 
+template <typename Reference, typename T> using match_constness_t = typename match_constness<Reference, T>::type;
+
 // Safe downcasting functions.
 template<typename Target, typename Source>
-inline typename match_constness<Source, Target>::type& downcast(Source& source)
+inline match_constness_t<Source, Target>& downcast(Source& source)
 {
     static_assert(!std::is_same<Source, Target>::value, "Unnecessary cast to same type");
     static_assert(std::is_base_of<Source, Target>::value, "Should be a downcast");
     ASSERT_WITH_SECURITY_IMPLICATION(is<Target>(source));
-    return static_cast<typename match_constness<Source, Target>::type&>(source);
+    return static_cast<match_constness_t<Source, Target>&>(source);
 }
 template<typename Target, typename Source>
-inline typename match_constness<Source, Target>::type* downcast(Source* source)
+inline match_constness_t<Source, Target>* downcast(Source* source)
 {
     static_assert(!std::is_same<Source, Target>::value, "Unnecessary cast to same type");
     static_assert(std::is_base_of<Source, Target>::value, "Should be a downcast");
     ASSERT_WITH_SECURITY_IMPLICATION(!source || is<Target>(*source));
-    return static_cast<typename match_constness<Source, Target>::type*>(source);
+    return static_cast<match_constness_t<Source, Target>*>(source);
 }
 
 // Add support for type checking / casting using is<>() / downcast<>() helpers for a specific class.

Modified: trunk/Source/WTF/wtf/Vector.h (223315 => 223316)


--- trunk/Source/WTF/wtf/Vector.h	2017-10-14 02:38:09 UTC (rev 223315)
+++ trunk/Source/WTF/wtf/Vector.h	2017-10-14 04:45:20 UTC (rev 223316)
@@ -563,9 +563,9 @@
     // FIXME: Add a redzone before the buffer to catch off by one accesses. We don't need a guard after, because the buffer is the last member variable.
     static const size_t asanInlineBufferAlignment = std::alignment_of<T>::value >= 8 ? std::alignment_of<T>::value : 8;
     static const size_t asanAdjustedInlineCapacity = ((sizeof(T) * inlineCapacity + 7) & ~7) / sizeof(T);
-    typename std::aligned_storage<sizeof(T), asanInlineBufferAlignment>::type m_inlineBuffer[asanAdjustedInlineCapacity];
+    std::aligned_storage_t<sizeof(T), asanInlineBufferAlignment> m_inlineBuffer[asanAdjustedInlineCapacity];
 #else
-    typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::type m_inlineBuffer[inlineCapacity];
+    std::aligned_storage_t<sizeof(T), std::alignment_of<T>::value> m_inlineBuffer[inlineCapacity];
 #endif
 };
 
@@ -795,7 +795,7 @@
 
     void checkConsistency();
 
-    template<typename MapFunction, typename R = typename std::result_of<MapFunction(const T&)>::type> Vector<R> map(MapFunction) const;
+    template<typename MapFunction, typename R = std::result_of_t<MapFunction(const T&)>> Vector<R> map(MapFunction) const;
 
 private:
     void expandCapacity(size_t newMinCapacity);
@@ -1305,7 +1305,7 @@
 {
     ASSERT(size() == capacity());
 
-    auto ptr = const_cast<typename std::remove_const<typename std::remove_reference<U>::type>::type*>(std::addressof(value));
+    auto ptr = const_cast<std::remove_const_t<std::remove_reference_t<U>>*>(std::addressof(value));
     ptr = expandCapacity(size() + 1, ptr);
     ASSERT(begin());
 
@@ -1391,7 +1391,7 @@
 {
     ASSERT_WITH_SECURITY_IMPLICATION(position <= size());
 
-    auto ptr = const_cast<typename std::remove_const<typename std::remove_reference<U>::type>::type*>(std::addressof(value));
+    auto ptr = const_cast<std::remove_const_t<std::remove_reference_t<U>>*>(std::addressof(value));
     if (size() == capacity()) {
         ptr = expandCapacity(size() + 1, ptr);
         ASSERT(begin());
@@ -1591,7 +1591,7 @@
 
 template<typename SourceType>
 struct CollectionInspector {
-    using RealSourceType = typename std::remove_reference<SourceType>::type;
+    using RealSourceType = std::remove_reference_t<SourceType>;
     using IteratorType = decltype(std::begin(std::declval<RealSourceType>()));
     using SourceItemType = typename std::iterator_traits<IteratorType>::value_type;
 };
@@ -1599,7 +1599,7 @@
 template<typename MapFunction, typename SourceType, typename Enable = void>
 struct Mapper {
     using SourceItemType = typename CollectionInspector<SourceType>::SourceItemType;
-    using DestinationItemType = typename std::result_of<MapFunction(SourceItemType&)>::type;
+    using DestinationItemType = std::result_of_t<MapFunction(SourceItemType&)>;
 
     static Vector<DestinationItemType> map(SourceType source, const MapFunction& mapFunction)
     {
@@ -1613,9 +1613,9 @@
 };
 
 template<typename MapFunction, typename SourceType>
-struct Mapper<MapFunction, SourceType, typename std::enable_if<std::is_rvalue_reference<SourceType&&>::value>::type> {
+struct Mapper<MapFunction, SourceType, std::enable_if_t<std::is_rvalue_reference<SourceType&&>::value>> {
     using SourceItemType = typename CollectionInspector<SourceType>::SourceItemType;
-    using DestinationItemType = typename std::result_of<MapFunction(SourceItemType&&)>::type;
+    using DestinationItemType = std::result_of_t<MapFunction(SourceItemType&&)>;
 
     static Vector<DestinationItemType> map(SourceType&& source, const MapFunction& mapFunction)
     {
@@ -1653,7 +1653,7 @@
 
 template<typename Collection>
 struct CopyToVectorResult {
-    using Type = typename std::remove_cv<typename CollectionInspector<Collection>::SourceItemType>::type;
+    using Type = std::remove_cv_t<typename CollectionInspector<Collection>::SourceItemType>;
 };
 
 template<typename Collection>

Modified: trunk/Source/WTF/wtf/text/IntegerToStringConversion.h (223315 => 223316)


--- trunk/Source/WTF/wtf/text/IntegerToStringConversion.h	2017-10-14 02:38:09 UTC (rev 223315)
+++ trunk/Source/WTF/wtf/text/IntegerToStringConversion.h	2017-10-14 04:45:20 UTC (rev 223316)
@@ -53,8 +53,8 @@
 inline typename IntegerToStringConversionTrait<T>::ReturnType numberToStringSigned(SignedIntegerType number, typename IntegerToStringConversionTrait<T>::AdditionalArgumentType* additionalArgument = nullptr)
 {
     if (number < 0)
-        return numberToStringImpl<T, typename std::make_unsigned<SignedIntegerType>::type, NegativeNumber>(-number, additionalArgument);
-    return numberToStringImpl<T, typename std::make_unsigned<SignedIntegerType>::type, PositiveNumber>(number, additionalArgument);
+        return numberToStringImpl<T, std::make_unsigned_t<SignedIntegerType>, NegativeNumber>(-number, additionalArgument);
+    return numberToStringImpl<T, std::make_unsigned_t<SignedIntegerType>, PositiveNumber>(number, additionalArgument);
 }
 
 template<typename T, typename UnsignedIntegerType>
@@ -87,8 +87,8 @@
 inline void writeNumberToBufferSigned(SignedIntegerType number, CharacterType* destination)
 {
     if (number < 0)
-        return writeNumberToBufferImpl<CharacterType, typename std::make_unsigned<SignedIntegerType>::type, NegativeNumber>(-number, destination);
-    return writeNumberToBufferImpl<CharacterType, typename std::make_unsigned<SignedIntegerType>::type, PositiveNumber>(number, destination);
+        return writeNumberToBufferImpl<CharacterType, std::make_unsigned_t<SignedIntegerType>, NegativeNumber>(-number, destination);
+    return writeNumberToBufferImpl<CharacterType, std::make_unsigned_t<SignedIntegerType>, PositiveNumber>(number, destination);
 }
 
 template<typename CharacterType, typename UnsignedIntegerType>
@@ -118,8 +118,8 @@
 inline unsigned lengthOfNumberAsStringSigned(SignedIntegerType number)
 {
     if (number < 0)
-        return lengthOfNumberAsStringImpl<typename std::make_unsigned<SignedIntegerType>::type, NegativeNumber>(-number);
-    return lengthOfNumberAsStringImpl<typename std::make_unsigned<SignedIntegerType>::type, PositiveNumber>(number);
+        return lengthOfNumberAsStringImpl<std::make_unsigned_t<SignedIntegerType>, NegativeNumber>(-number);
+    return lengthOfNumberAsStringImpl<std::make_unsigned_t<SignedIntegerType>, PositiveNumber>(number);
 }
 
 template<typename UnsignedIntegerType>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to