Changeset 223316 in webkit
- Timestamp:
- Oct 13, 2017 9:45:20 PM (6 years ago)
- Location:
- trunk/Source/WTF
- Files:
-
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r223315 r223316 1 2017-10-13 Sam Weinig <sam@webkit.org> 2 3 Adopt type trait template aliases everywhere in WTF 4 https://bugs.webkit.org/show_bug.cgi?id=178299 5 6 Reviewed by Yusuke Suzuki. 7 8 Adopt type trait template aliases (e.g. replace 'typename std::make_unsigned<Source>::type' 9 with 'std::make_unsigned_t<Source>'). Also adopt using over typedef consistently. 10 11 * wtf/Atomics.h: 12 * wtf/CagedUniquePtr.h: 13 * wtf/CheckedArithmetic.h: 14 * wtf/CompletionHandler.h: 15 * wtf/Function.h: 16 * wtf/HashCountedSet.h: 17 * wtf/HashFunctions.h: 18 * wtf/HashMap.h: 19 * wtf/HashSet.h: 20 * wtf/HashTable.h: 21 * wtf/HashTraits.h: 22 * wtf/IndexedContainerIterator.h: 23 * wtf/IteratorAdaptors.h: 24 * wtf/KeyValuePair.h: 25 * wtf/LEBDecoder.h: 26 * wtf/ListHashSet.h: 27 * wtf/MathExtras.h: 28 * wtf/NeverDestroyed.h: 29 * wtf/OptionSet.h: 30 * wtf/RetainPtr.h: 31 * wtf/SizeLimits.cpp: 32 * wtf/StdLibExtras.h: 33 * wtf/SystemFree.h: 34 * wtf/ThreadSpecific.h: 35 * wtf/TypeCasts.h: 36 * wtf/Vector.h: 37 * wtf/text/IntegerToStringConversion.h: 38 1 39 2017-10-13 Jer Noble <jer.noble@apple.com> 2 40 -
trunk/Source/WTF/wtf/Atomics.h
r217722 r223316 347 347 } 348 348 349 template <typename T, typename std::enable_if<sizeof(T) == 8>::type* = nullptr>349 template <typename T, std::enable_if_t<sizeof(T) == 8>* = nullptr> 350 350 ALWAYS_INLINE Dependency dependency(T value) 351 351 { … … 380 380 // FIXME: This code is almost identical to the other dependency() overload. 381 381 // https://bugs.webkit.org/show_bug.cgi?id=169405 382 template <typename T, typename std::enable_if<sizeof(T) == 4>::type* = nullptr>382 template <typename T, std::enable_if_t<sizeof(T) == 4>* = nullptr> 383 383 ALWAYS_INLINE Dependency dependency(T value) 384 384 { … … 401 401 } 402 402 403 template <typename T, typename std::enable_if<sizeof(T) == 2>::type* = nullptr>403 template <typename T, std::enable_if_t<sizeof(T) == 2>* = nullptr> 404 404 ALWAYS_INLINE Dependency dependency(T value) 405 405 { … … 407 407 } 408 408 409 template <typename T, typename std::enable_if<sizeof(T) == 1>::type* = nullptr>409 template <typename T, std::enable_if_t<sizeof(T) == 1>* = nullptr> 410 410 ALWAYS_INLINE Dependency dependency(T value) 411 411 { -
trunk/Source/WTF/wtf/CagedUniquePtr.h
r220712 r223316 80 80 81 81 template<Gigacage::Kind kind, typename T> 82 class CagedUniquePtr<kind, T[], typename std::enable_if<std::is_trivially_destructible<T>::value>::type> : public CagedPtr<kind, T> {82 class CagedUniquePtr<kind, T[], std::enable_if_t<std::is_trivially_destructible<T>::value>> : public CagedPtr<kind, T> { 83 83 public: 84 84 CagedUniquePtr() : CagedPtr<kind, T>() { } … … 131 131 132 132 template<Gigacage::Kind kind, typename T> 133 class CagedUniquePtr<kind, T[], typename std::enable_if<!std::is_trivially_destructible<T>::value>::type> : public CagedPtr<kind, T> {133 class CagedUniquePtr<kind, T[], std::enable_if_t<!std::is_trivially_destructible<T>::value>> : public CagedPtr<kind, T> { 134 134 public: 135 135 CagedUniquePtr() : CagedPtr<kind, T>() { } -
trunk/Source/WTF/wtf/CheckedArithmetic.h
r195298 r223316 144 144 // When converting value to unsigned Source, value will become a big value if value is negative. 145 145 // Casted value will become bigger than Target::max as Source is bigger than Target. 146 return static_cast< typename std::make_unsigned<Source>::type>(value) <= std::numeric_limits<Target>::max();146 return static_cast<std::make_unsigned_t<Source>>(value) <= std::numeric_limits<Target>::max(); 147 147 } 148 148 }; -
trunk/Source/WTF/wtf/CompletionHandler.h
r221059 r223316 38 38 CompletionHandler() = default; 39 39 40 template<typename CallableType, class = typename std::enable_if<std::is_rvalue_reference<CallableType&&>::value>::type>40 template<typename CallableType, class = std::enable_if_t<std::is_rvalue_reference<CallableType&&>::value>> 41 41 CompletionHandler(CallableType&& callable) 42 42 : m_function(WTFMove(callable)) -
trunk/Source/WTF/wtf/Function.h
r220601 r223316 39 39 Function(std::nullptr_t) { } 40 40 41 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>41 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>> 42 42 Function(CallableType&& callable) 43 43 : m_callableWrapper(std::make_unique<CallableWrapper<CallableType>>(WTFMove(callable))) … … 45 45 } 46 46 47 template<typename FunctionType, class = typename std::enable_if<std::is_pointer<FunctionType>::value && std::is_function<typename std::remove_pointer<FunctionType>::type>::value>::type>47 template<typename FunctionType, class = std::enable_if_t<std::is_pointer<FunctionType>::value && std::is_function<std::remove_pointer_t<FunctionType>>::value>> 48 48 Function(FunctionType f) 49 49 : m_callableWrapper(std::make_unique<CallableWrapper<FunctionType>>(WTFMove(f))) … … 59 59 explicit operator bool() const { return !!m_callableWrapper; } 60 60 61 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>61 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>> 62 62 Function& operator=(CallableType&& callable) 63 63 { … … 66 66 } 67 67 68 template<typename FunctionType, class = typename std::enable_if<std::is_pointer<FunctionType>::value && std::is_function<typename std::remove_pointer<FunctionType>::type>::value>::type>68 template<typename FunctionType, class = std::enable_if_t<std::is_pointer<FunctionType>::value && std::is_function<std::remove_pointer_t<FunctionType>>::value>> 69 69 Function& operator=(FunctionType f) 70 70 { -
trunk/Source/WTF/wtf/HashCountedSet.h
r223258 r223316 102 102 103 103 // Overloads for smart pointer keys that take the raw pointer type as the parameter. 104 template<typename V = ValueType> typename std::enable_if<IsSmartPtr<V>::value, iterator>::typefind(typename GetPtrHelper<V>::PtrType);105 template<typename V = ValueType> typename std::enable_if<IsSmartPtr<V>::value, const_iterator>::typefind(typename GetPtrHelper<V>::PtrType) const;106 template<typename V = ValueType> typename std::enable_if<IsSmartPtr<V>::value, bool>::typecontains(typename GetPtrHelper<V>::PtrType) const;107 template<typename V = ValueType> typename std::enable_if<IsSmartPtr<V>::value, unsigned>::typecount(typename GetPtrHelper<V>::PtrType) const;108 template<typename V = ValueType> typename std::enable_if<IsSmartPtr<V>::value, bool>::typeremove(typename GetPtrHelper<V>::PtrType);104 template<typename V = ValueType> std::enable_if_t<IsSmartPtr<V>::value, iterator> find(typename GetPtrHelper<V>::PtrType); 105 template<typename V = ValueType> std::enable_if_t<IsSmartPtr<V>::value, const_iterator> find(typename GetPtrHelper<V>::PtrType) const; 106 template<typename V = ValueType> std::enable_if_t<IsSmartPtr<V>::value, bool> contains(typename GetPtrHelper<V>::PtrType) const; 107 template<typename V = ValueType> std::enable_if_t<IsSmartPtr<V>::value, unsigned> count(typename GetPtrHelper<V>::PtrType) const; 108 template<typename V = ValueType> std::enable_if_t<IsSmartPtr<V>::value, bool> remove(typename GetPtrHelper<V>::PtrType); 109 109 110 110 private: … … 277 277 template<typename Value, typename HashFunctions, typename Traits> 278 278 template<typename V> 279 inline auto HashCountedSet<Value, HashFunctions, Traits>::find(typename GetPtrHelper<V>::PtrType value) -> typename std::enable_if<IsSmartPtr<V>::value, iterator>::type279 inline auto HashCountedSet<Value, HashFunctions, Traits>::find(typename GetPtrHelper<V>::PtrType value) -> std::enable_if_t<IsSmartPtr<V>::value, iterator> 280 280 { 281 281 return m_impl.find(value); … … 284 284 template<typename Value, typename HashFunctions, typename Traits> 285 285 template<typename V> 286 inline auto HashCountedSet<Value, HashFunctions, Traits>::find(typename GetPtrHelper<V>::PtrType value) const -> typename std::enable_if<IsSmartPtr<V>::value, const_iterator>::type286 inline auto HashCountedSet<Value, HashFunctions, Traits>::find(typename GetPtrHelper<V>::PtrType value) const -> std::enable_if_t<IsSmartPtr<V>::value, const_iterator> 287 287 { 288 288 return m_impl.find(value); … … 291 291 template<typename Value, typename HashFunctions, typename Traits> 292 292 template<typename V> 293 inline auto HashCountedSet<Value, HashFunctions, Traits>::contains(typename GetPtrHelper<V>::PtrType value) const -> typename std::enable_if<IsSmartPtr<V>::value, bool>::type293 inline auto HashCountedSet<Value, HashFunctions, Traits>::contains(typename GetPtrHelper<V>::PtrType value) const -> std::enable_if_t<IsSmartPtr<V>::value, bool> 294 294 { 295 295 return m_impl.contains(value); … … 298 298 template<typename Value, typename HashFunctions, typename Traits> 299 299 template<typename V> 300 inline auto HashCountedSet<Value, HashFunctions, Traits>::count(typename GetPtrHelper<V>::PtrType value) const -> typename std::enable_if<IsSmartPtr<V>::value, unsigned>::type300 inline auto HashCountedSet<Value, HashFunctions, Traits>::count(typename GetPtrHelper<V>::PtrType value) const -> std::enable_if_t<IsSmartPtr<V>::value, unsigned> 301 301 { 302 302 return m_impl.get(value); … … 305 305 template<typename Value, typename HashFunctions, typename Traits> 306 306 template<typename V> 307 inline auto HashCountedSet<Value, HashFunctions, Traits>::remove(typename GetPtrHelper<V>::PtrType value) -> typename std::enable_if<IsSmartPtr<V>::value, bool>::type307 inline auto HashCountedSet<Value, HashFunctions, Traits>::remove(typename GetPtrHelper<V>::PtrType value) -> std::enable_if_t<IsSmartPtr<V>::value, bool> 308 308 { 309 309 return remove(find(value)); -
trunk/Source/WTF/wtf/HashFunctions.h
r212992 r223316 179 179 struct TupleHash { 180 180 template<size_t I = 0> 181 static typename std::enable_if<I < sizeof...(Types) - 1, unsigned>::typehash(const std::tuple<Types...>& t)182 { 183 using IthTupleElementType = typename std::tuple_element<I, typename std::tuple<Types...>>::type;181 static std::enable_if_t<I < sizeof...(Types) - 1, unsigned> hash(const std::tuple<Types...>& t) 182 { 183 using IthTupleElementType = std::tuple_element_t<I, typename std::tuple<Types...>>; 184 184 return pairIntHash(DefaultHash<IthTupleElementType>::Hash::hash(std::get<I>(t)), hash<I + 1>(t)); 185 185 } 186 186 187 187 template<size_t I = 0> 188 static typename std::enable_if<I == sizeof...(Types) - 1, unsigned>::typehash(const std::tuple<Types...>& t)189 { 190 using IthTupleElementType = typename std::tuple_element<I, typename std::tuple<Types...>>::type;188 static std::enable_if_t<I == sizeof...(Types) - 1, unsigned> hash(const std::tuple<Types...>& t) 189 { 190 using IthTupleElementType = std::tuple_element_t<I, typename std::tuple<Types...>>; 191 191 return DefaultHash<IthTupleElementType>::Hash::hash(std::get<I>(t)); 192 192 } 193 193 194 194 template<size_t I = 0> 195 static typename std::enable_if<I < sizeof...(Types) - 1, bool>::typeequal(const std::tuple<Types...>& a, const std::tuple<Types...>& b)196 { 197 using IthTupleElementType = typename std::tuple_element<I, typename std::tuple<Types...>>::type;195 static std::enable_if_t<I < sizeof...(Types) - 1, bool> equal(const std::tuple<Types...>& a, const std::tuple<Types...>& b) 196 { 197 using IthTupleElementType = std::tuple_element_t<I, typename std::tuple<Types...>>; 198 198 return DefaultHash<IthTupleElementType>::Hash::equal(std::get<I>(a), std::get<I>(b)) && equal<I + 1>(a, b); 199 199 } 200 200 201 201 template<size_t I = 0> 202 static typename std::enable_if<I == sizeof...(Types) - 1, bool>::typeequal(const std::tuple<Types...>& a, const std::tuple<Types...>& b)203 { 204 using IthTupleElementType = typename std::tuple_element<I, typename std::tuple<Types...>>::type;202 static std::enable_if_t<I == sizeof...(Types) - 1, bool> equal(const std::tuple<Types...>& a, const std::tuple<Types...>& b) 203 { 204 using IthTupleElementType = std::tuple_element_t<I, typename std::tuple<Types...>>; 205 205 return DefaultHash<IthTupleElementType>::Hash::equal(std::get<I>(a), std::get<I>(b)); 206 206 } -
trunk/Source/WTF/wtf/HashMap.h
r223266 r223316 161 161 162 162 // Overloads for smart pointer keys that take the raw pointer type as the parameter. 163 template<typename K = KeyType> typename std::enable_if<IsSmartPtr<K>::value, iterator>::typefind(typename GetPtrHelper<K>::PtrType);164 template<typename K = KeyType> typename std::enable_if<IsSmartPtr<K>::value, const_iterator>::typefind(typename GetPtrHelper<K>::PtrType) const;165 template<typename K = KeyType> typename std::enable_if<IsSmartPtr<K>::value, bool>::typecontains(typename GetPtrHelper<K>::PtrType) const;166 template<typename K = KeyType> typename std::enable_if<IsSmartPtr<K>::value, MappedPeekType>::typeinlineGet(typename GetPtrHelper<K>::PtrType) const;167 template<typename K = KeyType> typename std::enable_if<IsSmartPtr<K>::value, MappedPeekType>::typeget(typename GetPtrHelper<K>::PtrType) const;168 template<typename K = KeyType> typename std::enable_if<IsSmartPtr<K>::value, bool>::typeremove(typename GetPtrHelper<K>::PtrType);169 template<typename K = KeyType> typename std::enable_if<IsSmartPtr<K>::value, MappedTakeType>::typetake(typename GetPtrHelper<K>::PtrType);163 template<typename K = KeyType> std::enable_if_t<IsSmartPtr<K>::value, iterator> find(typename GetPtrHelper<K>::PtrType); 164 template<typename K = KeyType> std::enable_if_t<IsSmartPtr<K>::value, const_iterator> find(typename GetPtrHelper<K>::PtrType) const; 165 template<typename K = KeyType> std::enable_if_t<IsSmartPtr<K>::value, bool> contains(typename GetPtrHelper<K>::PtrType) const; 166 template<typename K = KeyType> std::enable_if_t<IsSmartPtr<K>::value, MappedPeekType> inlineGet(typename GetPtrHelper<K>::PtrType) const; 167 template<typename K = KeyType> std::enable_if_t<IsSmartPtr<K>::value, MappedPeekType> get(typename GetPtrHelper<K>::PtrType) const; 168 template<typename K = KeyType> std::enable_if_t<IsSmartPtr<K>::value, bool> remove(typename GetPtrHelper<K>::PtrType); 169 template<typename K = KeyType> std::enable_if_t<IsSmartPtr<K>::value, MappedTakeType> take(typename GetPtrHelper<K>::PtrType); 170 170 171 171 void checkConsistency() const; … … 474 474 template<typename T, typename U, typename V, typename W, typename X> 475 475 template<typename K> 476 inline auto HashMap<T, U, V, W, X>::find(typename GetPtrHelper<K>::PtrType key) -> typename std::enable_if<IsSmartPtr<K>::value, iterator>::type476 inline auto HashMap<T, U, V, W, X>::find(typename GetPtrHelper<K>::PtrType key) -> std::enable_if_t<IsSmartPtr<K>::value, iterator> 477 477 { 478 478 return m_impl.template find<HashMapTranslator<KeyValuePairTraits, HashFunctions>>(key); … … 481 481 template<typename T, typename U, typename V, typename W, typename X> 482 482 template<typename K> 483 inline auto HashMap<T, U, V, W, X>::find(typename GetPtrHelper<K>::PtrType key) const -> typename std::enable_if<IsSmartPtr<K>::value, const_iterator>::type483 inline auto HashMap<T, U, V, W, X>::find(typename GetPtrHelper<K>::PtrType key) const -> std::enable_if_t<IsSmartPtr<K>::value, const_iterator> 484 484 { 485 485 return m_impl.template find<HashMapTranslator<KeyValuePairTraits, HashFunctions>>(key); … … 488 488 template<typename T, typename U, typename V, typename W, typename X> 489 489 template<typename K> 490 inline auto HashMap<T, U, V, W, X>::contains(typename GetPtrHelper<K>::PtrType key) const -> typename std::enable_if<IsSmartPtr<K>::value, bool>::type490 inline auto HashMap<T, U, V, W, X>::contains(typename GetPtrHelper<K>::PtrType key) const -> std::enable_if_t<IsSmartPtr<K>::value, bool> 491 491 { 492 492 return m_impl.template contains<HashMapTranslator<KeyValuePairTraits, HashFunctions>>(key); … … 495 495 template<typename T, typename U, typename V, typename W, typename X> 496 496 template<typename K> 497 inline auto HashMap<T, U, V, W, X>::inlineGet(typename GetPtrHelper<K>::PtrType key) const -> typename std::enable_if<IsSmartPtr<K>::value, MappedPeekType>::type497 inline auto HashMap<T, U, V, W, X>::inlineGet(typename GetPtrHelper<K>::PtrType key) const -> std::enable_if_t<IsSmartPtr<K>::value, MappedPeekType> 498 498 { 499 499 KeyValuePairType* entry = const_cast<HashTableType&>(m_impl).template inlineLookup<HashMapTranslator<KeyValuePairTraits, HashFunctions>>(key); … … 505 505 template<typename T, typename U, typename V, typename W, typename X> 506 506 template<typename K> 507 auto HashMap<T, U, V, W, X>::get(typename GetPtrHelper<K>::PtrType key) const -> typename std::enable_if<IsSmartPtr<K>::value, MappedPeekType>::type507 auto HashMap<T, U, V, W, X>::get(typename GetPtrHelper<K>::PtrType key) const -> std::enable_if_t<IsSmartPtr<K>::value, MappedPeekType> 508 508 { 509 509 return inlineGet(key); … … 512 512 template<typename T, typename U, typename V, typename W, typename X> 513 513 template<typename K> 514 inline auto HashMap<T, U, V, W, X>::remove(typename GetPtrHelper<K>::PtrType key) -> typename std::enable_if<IsSmartPtr<K>::value, bool>::type514 inline auto HashMap<T, U, V, W, X>::remove(typename GetPtrHelper<K>::PtrType key) -> std::enable_if_t<IsSmartPtr<K>::value, bool> 515 515 { 516 516 return remove(find(key)); … … 519 519 template<typename T, typename U, typename V, typename W, typename X> 520 520 template<typename K> 521 inline auto HashMap<T, U, V, W, X>::take(typename GetPtrHelper<K>::PtrType key) -> typename std::enable_if<IsSmartPtr<K>::value, MappedTakeType>::type521 inline auto HashMap<T, U, V, W, X>::take(typename GetPtrHelper<K>::PtrType key) -> std::enable_if_t<IsSmartPtr<K>::value, MappedTakeType> 522 522 { 523 523 iterator it = find(key); -
trunk/Source/WTF/wtf/HashSet.h
r223266 r223316 35 35 WTF_MAKE_FAST_ALLOCATED; 36 36 private: 37 typedef HashArg HashFunctions;38 typedef TraitsArg ValueTraits;39 typedef typename ValueTraits::TakeTypeTakeType;37 using HashFunctions = HashArg; 38 using ValueTraits = TraitsArg; 39 using TakeType = typename ValueTraits::TakeType; 40 40 41 41 public: 42 typedef typename ValueTraits::TraitType ValueType;42 using ValueType = typename ValueTraits::TraitType; 43 43 44 44 private: 45 typedef HashTable<ValueType, ValueType, IdentityExtractor, 46 HashFunctions, ValueTraits, ValueTraits> HashTableType; 45 using HashTableType = HashTable<ValueType, ValueType, IdentityExtractor, HashFunctions, ValueTraits, ValueTraits>; 47 46 48 47 public: 49 typedef HashTableConstIteratorAdapter<HashTableType, ValueType> iterator;50 typedef HashTableConstIteratorAdapter<HashTableType, ValueType> const_iterator;51 typedef typename HashTableType::AddResultAddResult;48 using iterator = HashTableConstIteratorAdapter<HashTableType, ValueType>; 49 using const_iterator = HashTableConstIteratorAdapter<HashTableType, ValueType>; 50 using AddResult= typename HashTableType::AddResult; 52 51 53 52 HashSet() … … 114 113 115 114 // Overloads for smart pointer values that take the raw pointer type as the parameter. 116 template<typename V = ValueType> typename std::enable_if<IsSmartPtr<V>::value, iterator>::typefind(typename GetPtrHelper<V>::PtrType) const;117 template<typename V = ValueType> typename std::enable_if<IsSmartPtr<V>::value, bool>::typecontains(typename GetPtrHelper<V>::PtrType) const;118 template<typename V = ValueType> typename std::enable_if<IsSmartPtr<V>::value, bool>::typeremove(typename GetPtrHelper<V>::PtrType);119 template<typename V = ValueType> typename std::enable_if<IsSmartPtr<V>::value, TakeType>::typetake(typename GetPtrHelper<V>::PtrType);115 template<typename V = ValueType> std::enable_if_t<IsSmartPtr<V>::value, iterator> find(typename GetPtrHelper<V>::PtrType) const; 116 template<typename V = ValueType> std::enable_if_t<IsSmartPtr<V>::value, bool> contains(typename GetPtrHelper<V>::PtrType) const; 117 template<typename V = ValueType> std::enable_if_t<IsSmartPtr<V>::value, bool> remove(typename GetPtrHelper<V>::PtrType); 118 template<typename V = ValueType> std::enable_if_t<IsSmartPtr<V>::value, TakeType> take(typename GetPtrHelper<V>::PtrType); 120 119 121 120 static bool isValidValue(const ValueType&); … … 312 311 template<typename Value, typename HashFunctions, typename Traits> 313 312 template<typename V> 314 inline auto HashSet<Value, HashFunctions, Traits>::find(typename GetPtrHelper<V>::PtrType value) const -> typename std::enable_if<IsSmartPtr<V>::value, iterator>::type313 inline auto HashSet<Value, HashFunctions, Traits>::find(typename GetPtrHelper<V>::PtrType value) const -> std::enable_if_t<IsSmartPtr<V>::value, iterator> 315 314 { 316 315 return m_impl.template find<HashSetTranslator<Traits, HashFunctions>>(value); … … 319 318 template<typename Value, typename HashFunctions, typename Traits> 320 319 template<typename V> 321 inline auto HashSet<Value, HashFunctions, Traits>::contains(typename GetPtrHelper<V>::PtrType value) const -> typename std::enable_if<IsSmartPtr<V>::value, bool>::type320 inline auto HashSet<Value, HashFunctions, Traits>::contains(typename GetPtrHelper<V>::PtrType value) const -> std::enable_if_t<IsSmartPtr<V>::value, bool> 322 321 { 323 322 return m_impl.template contains<HashSetTranslator<Traits, HashFunctions>>(value); … … 326 325 template<typename Value, typename HashFunctions, typename Traits> 327 326 template<typename V> 328 inline auto HashSet<Value, HashFunctions, Traits>::remove(typename GetPtrHelper<V>::PtrType value) -> typename std::enable_if<IsSmartPtr<V>::value, bool>::type327 inline auto HashSet<Value, HashFunctions, Traits>::remove(typename GetPtrHelper<V>::PtrType value) -> std::enable_if_t<IsSmartPtr<V>::value, bool> 329 328 { 330 329 return remove(find(value)); … … 333 332 template<typename Value, typename HashFunctions, typename Traits> 334 333 template<typename V> 335 inline auto HashSet<Value, HashFunctions, Traits>::take(typename GetPtrHelper<V>::PtrType value) -> typename std::enable_if<IsSmartPtr<V>::value, TakeType>::type334 inline auto HashSet<Value, HashFunctions, Traits>::take(typename GetPtrHelper<V>::PtrType value) -> std::enable_if_t<IsSmartPtr<V>::value, TakeType> 336 335 { 337 336 return take(find(value)); -
trunk/Source/WTF/wtf/HashTable.h
r214299 r223316 106 106 class HashTableConstIterator : public std::iterator<std::forward_iterator_tag, Value, std::ptrdiff_t, const Value*, const Value&> { 107 107 private: 108 typedef HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits> HashTableType;109 typedef HashTableIterator<Key, Value, Extractor, HashFunctions, Traits, KeyTraits> iterator;110 typedef HashTableConstIterator<Key, Value, Extractor, HashFunctions, Traits, KeyTraits> const_iterator;111 typedef Value ValueType;112 typedef const ValueType& ReferenceType;113 typedef const ValueType* PointerType;108 using HashTableType = HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>; 109 using iterator = HashTableIterator<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>; 110 using const_iterator = HashTableConstIterator<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>; 111 using ValueType = Value; 112 using ReferenceType = const ValueType&; 113 using PointerType = const ValueType*; 114 114 115 115 friend class HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>; … … 242 242 class HashTableIterator : public std::iterator<std::forward_iterator_tag, Value, std::ptrdiff_t, Value*, Value&> { 243 243 private: 244 typedef HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits> HashTableType;245 typedef HashTableIterator<Key, Value, Extractor, HashFunctions, Traits, KeyTraits> iterator;246 typedef HashTableConstIterator<Key, Value, Extractor, HashFunctions, Traits, KeyTraits> const_iterator;247 typedef Value ValueType;248 typedef ValueType& ReferenceType;249 typedef ValueType* PointerType;244 using HashTableType = HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>; 245 using iterator = HashTableIterator<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>; 246 using const_iterator = HashTableConstIterator<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>; 247 using ValueType = Value; 248 using ReferenceType = ValueType&; 249 using PointerType = ValueType*; 250 250 251 251 friend class HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>; … … 301 301 class HashTable { 302 302 public: 303 typedef HashTableIterator<Key, Value, Extractor, HashFunctions, Traits, KeyTraits> iterator;304 typedef HashTableConstIterator<Key, Value, Extractor, HashFunctions, Traits, KeyTraits> const_iterator;305 typedef Traits ValueTraits;306 typedef Key KeyType;307 typedef Value ValueType;308 typedef IdentityHashTranslator<ValueTraits, HashFunctions> IdentityTranslatorType;309 typedef HashTableAddResult<iterator> AddResult;303 using iterator = HashTableIterator<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>; 304 using const_iterator = HashTableConstIterator<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>; 305 using ValueTraits = Traits; 306 using KeyType = Key; 307 using ValueType = Value; 308 using IdentityTranslatorType = IdentityHashTranslator<ValueTraits, HashFunctions>; 309 using AddResult = HashTableAddResult<iterator>; 310 310 311 311 #if DUMP_HASHTABLE_STATS_PER_TABLE … … 434 434 static void deallocateTable(ValueType* table, unsigned size); 435 435 436 typedef std::pair<ValueType*, bool> LookupType;437 typedef std::pair<LookupType, unsigned> FullLookupType;436 using LookupType = std::pair<ValueType*, bool>; 437 using FullLookupType = std::pair<LookupType, unsigned>; 438 438 439 439 LookupType lookupForWriting(const Key& key) { return lookupForWriting<IdentityTranslatorType>(key); }; … … 586 586 return; 587 587 ASSERT(!HashTranslator::equal(KeyTraits::emptyValue(), key)); 588 typename std::aligned_storage<sizeof(ValueType), std::alignment_of<ValueType>::value>::typedeletedValueBuffer;588 std::aligned_storage_t<sizeof(ValueType), std::alignment_of<ValueType>::value> deletedValueBuffer; 589 589 ValueType* deletedValuePtr = reinterpret_cast_ptr<ValueType*>(&deletedValueBuffer); 590 590 ValueType& deletedValue = *deletedValuePtr; -
trunk/Source/WTF/wtf/HashTraits.h
r221914 r223316 106 106 // Can be used with strong enums, allows zero as key. 107 107 template<typename T> struct StrongEnumHashTraits : GenericHashTraits<T> { 108 using UnderlyingType = typename std::underlying_type<T>::type;108 using UnderlyingType = std::underlying_type_t<T>; 109 109 static const bool emptyValueIsZero = false; 110 110 static T emptyValue() { return static_cast<T>(std::numeric_limits<UnderlyingType>::max()); } … … 225 225 226 226 template<typename Traits, typename T> 227 typename std::enable_if<HashTraitHasCustomDelete<Traits, T>::value>::type 228 hashTraitsDeleteBucket(T& value) 227 auto hashTraitsDeleteBucket(T& value) -> std::enable_if_t<HashTraitHasCustomDelete<Traits, T>::value> 229 228 { 230 229 Traits::customDeleteBucket(value); … … 232 231 233 232 template<typename Traits, typename T> 234 typename std::enable_if<!HashTraitHasCustomDelete<Traits, T>::value>::type 235 hashTraitsDeleteBucket(T& value) 233 auto hashTraitsDeleteBucket(T& value) -> std::enable_if_t<!HashTraitHasCustomDelete<Traits, T>::value> 236 234 { 237 235 value.~T(); -
trunk/Source/WTF/wtf/IndexedContainerIterator.h
r204920 r223316 45 45 } 46 46 47 auto operator*() -> typename std::result_of<decltype(&Container::at)(const Container, unsigned)>::type47 auto operator*() -> std::result_of_t<decltype(&Container::at)(const Container, unsigned)> 48 48 { 49 49 return m_container->at(m_index); -
trunk/Source/WTF/wtf/IteratorAdaptors.h
r194496 r223316 53 53 } 54 54 55 const typename std::remove_const<decltype(*std::declval<Iterator>())>::typeoperator*() const55 const std::remove_const_t<decltype(*std::declval<Iterator>())> operator*() const 56 56 { 57 57 ASSERT(m_iter != m_end); … … 90 90 } 91 91 92 const typename std::remove_const<decltype(std::declval<Transform>()(*std::declval<Iterator>()))>::typeoperator*() const92 const std::remove_const_t<decltype(std::declval<Transform>()(*std::declval<Iterator>()))> operator*() const 93 93 { 94 94 return m_transform(*m_iter); -
trunk/Source/WTF/wtf/KeyValuePair.h
r221914 r223316 58 58 59 59 template<typename K, typename V> 60 inline KeyValuePair< typename std::decay<K>::type, typename std::decay<V>::type> makeKeyValuePair(K&& key, V&& value)60 inline KeyValuePair<std::decay_t<K>, std::decay_t<V>> makeKeyValuePair(K&& key, V&& value) 61 61 { 62 return KeyValuePair< typename std::decay<K>::type, typename std::decay<V>::type> { std::forward<K>(key), std::forward<V>(value) };62 return KeyValuePair<std::decay_t<K>, std::decay_t<V>> { std::forward<K>(key), std::forward<V>(value) }; 63 63 } 64 64 -
trunk/Source/WTF/wtf/LEBDecoder.h
r220562 r223316 80 80 } 81 81 82 using UnsignedT = typename std::make_unsigned<T>::type;82 using UnsignedT = std::make_unsigned_t<T>; 83 83 if (shift < numBits && (byte & 0x40)) 84 84 result = static_cast<T>(static_cast<UnsignedT>(result) | (static_cast<UnsignedT>(-1) << shift)); -
trunk/Source/WTF/wtf/ListHashSet.h
r223041 r223316 49 49 WTF_MAKE_FAST_ALLOCATED; 50 50 private: 51 typedef ListHashSetNode<ValueArg> Node;52 53 typedef HashTraits<Node*> NodeTraits;54 typedef ListHashSetNodeHashFunctions<HashArg> NodeHash;55 typedef ListHashSetTranslator<HashArg> BaseTranslator;56 57 typedef HashArg HashFunctions;51 using Node = ListHashSetNode<ValueArg>; 52 53 using NodeTraits = HashTraits<Node*>; 54 using NodeHash = ListHashSetNodeHashFunctions<HashArg>; 55 using BaseTranslator = ListHashSetTranslator<HashArg>; 56 57 using HashFunctions = HashArg; 58 58 59 59 public: 60 typedef ValueArg ValueType;61 62 typedef ListHashSetIterator<ValueType, HashArg> iterator;63 typedef ListHashSetConstIterator<ValueType, HashArg> const_iterator;60 using ValueType = ValueArg; 61 62 using iterator = ListHashSetIterator<ValueType, HashArg>; 63 using const_iterator = ListHashSetConstIterator<ValueType, HashArg>; 64 64 friend class ListHashSetConstIterator<ValueType, HashArg>; 65 65 66 typedef std::reverse_iterator<iterator> reverse_iterator;67 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;68 69 typedef HashTableAddResult<iterator> AddResult;66 using reverse_iterator = std::reverse_iterator<iterator>; 67 using const_reverse_iterator = std::reverse_iterator<const_iterator>; 68 69 using AddResult = HashTableAddResult<iterator>; 70 70 71 71 ListHashSet() = default; … … 178 178 template<typename ValueArg, typename HashArg> class ListHashSetIterator { 179 179 private: 180 typedef ListHashSet<ValueArg, HashArg> ListHashSetType;181 typedef ListHashSetIterator<ValueArg, HashArg> iterator;182 typedef ListHashSetConstIterator<ValueArg, HashArg> const_iterator;183 typedef ListHashSetNode<ValueArg> Node;184 typedef ValueArg ValueType;180 using ListHashSetType = ListHashSet<ValueArg, HashArg>; 181 using iterator = ListHashSetIterator<ValueArg, HashArg>; 182 using const_iterator = ListHashSetConstIterator<ValueArg, HashArg>; 183 using Node = ListHashSetNode<ValueArg>; 184 using ValueType = ValueArg; 185 185 186 186 friend class ListHashSet<ValueArg, HashArg>; … … 189 189 190 190 public: 191 typedef ptrdiff_t difference_type;192 typedef ValueType value_type;193 typedef ValueType* pointer;194 typedef ValueType& reference;195 typedef std::bidirectional_iterator_tag iterator_category;191 using difference_type = ptrdiff_t; 192 using value_type = ValueType; 193 using pointer = ValueType*; 194 using reference = ValueType&; 195 using iterator_category = std::bidirectional_iterator_tag; 196 196 197 197 ListHashSetIterator() { } … … 225 225 template<typename ValueArg, typename HashArg> class ListHashSetConstIterator { 226 226 private: 227 typedef ListHashSet<ValueArg, HashArg> ListHashSetType;228 typedef ListHashSetIterator<ValueArg, HashArg> iterator;229 typedef ListHashSetConstIterator<ValueArg, HashArg> const_iterator;230 typedef ListHashSetNode<ValueArg> Node;231 typedef ValueArg ValueType;227 using ListHashSetType = ListHashSet<ValueArg, HashArg>; 228 using iterator = ListHashSetIterator<ValueArg, HashArg>; 229 using const_iterator = ListHashSetConstIterator<ValueArg, HashArg>; 230 using Node = ListHashSetNode<ValueArg>; 231 using ValueType = ValueArg; 232 232 233 233 friend class ListHashSet<ValueArg, HashArg>; … … 241 241 242 242 public: 243 typedef ptrdiff_t difference_type;244 typedef const ValueType value_type;245 typedef const ValueType* pointer;246 typedef const ValueType& reference;247 typedef std::bidirectional_iterator_tag iterator_category;243 using difference_type = ptrdiff_t; 244 using value_type = const ValueType; 245 using pointer = const ValueType*; 246 using reference = const ValueType&; 247 using iterator_category = std::bidirectional_iterator_tag; 248 248 249 249 ListHashSetConstIterator() -
trunk/Source/WTF/wtf/MathExtras.h
r221600 r223316 210 210 template <typename T> inline unsigned getLSBSet(T value) 211 211 { 212 typedef typename std::make_unsigned<T>::typeUnsignedT;212 typedef std::make_unsigned_t<T> UnsignedT; 213 213 unsigned result = 0; 214 214 … … 374 374 375 375 template <typename T> 376 inline typename std::enable_if<std::is_floating_point<T>::value, T>::typesafeFPDivision(T u, T v)376 inline std::enable_if_t<std::is_floating_point<T>::value, T> safeFPDivision(T u, T v) 377 377 { 378 378 // Protect against overflow / underflow. … … 391 391 // [2] http://www.boost.org/doc/libs/1_34_0/libs/test/doc/components/test_tools/floating_point_comparison.html 392 392 template <typename T> 393 inline typename std::enable_if<std::is_floating_point<T>::value, bool>::typeareEssentiallyEqual(T u, T v, T epsilon = std::numeric_limits<T>::epsilon())393 inline std::enable_if_t<std::is_floating_point<T>::value, bool> areEssentiallyEqual(T u, T v, T epsilon = std::numeric_limits<T>::epsilon()) 394 394 { 395 395 if (u == v) … … 402 402 // Match behavior of Math.min, where NaN is returned if either argument is NaN. 403 403 template <typename T> 404 inline typename std::enable_if<std::is_floating_point<T>::value, T>::typenanPropagatingMin(T a, T b)404 inline std::enable_if_t<std::is_floating_point<T>::value, T> nanPropagatingMin(T a, T b) 405 405 { 406 406 return std::isnan(a) || std::isnan(b) ? std::numeric_limits<T>::quiet_NaN() : std::min(a, b); … … 409 409 // Match behavior of Math.max, where NaN is returned if either argument is NaN. 410 410 template <typename T> 411 inline typename std::enable_if<std::is_floating_point<T>::value, T>::typenanPropagatingMax(T a, T b)411 inline std::enable_if_t<std::is_floating_point<T>::value, T> nanPropagatingMax(T a, T b) 412 412 { 413 413 return std::isnan(a) || std::isnan(b) ? std::numeric_limits<T>::quiet_NaN() : std::max(a, b); -
trunk/Source/WTF/wtf/NeverDestroyed.h
r221951 r223316 63 63 64 64 private: 65 using PointerType = typename std::remove_const<T>::type*;65 using PointerType = std::remove_const_t<T>*; 66 66 67 67 PointerType storagePointer() const { return const_cast<PointerType>(reinterpret_cast<const T*>(&m_storage)); } … … 69 69 // FIXME: Investigate whether we should allocate a hunk of virtual memory 70 70 // and hand out chunks of it to NeverDestroyed instead, to reduce fragmentation. 71 typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::typem_storage;71 std::aligned_storage_t<sizeof(T), std::alignment_of<T>::value> m_storage; 72 72 73 73 template<typename PtrType, bool ShouldRelax = std::is_base_of<RefCountedBase, PtrType>::value> struct MaybeRelax { … … 117 117 118 118 private: 119 using PointerType = typename std::remove_const<T>::type*;119 using PointerType = std::remove_const_t<T>*; 120 120 121 121 PointerType storagePointer() const … … 127 127 // FIXME: Investigate whether we should allocate a hunk of virtual memory 128 128 // and hand out chunks of it to NeverDestroyed instead, to reduce fragmentation. 129 typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::typem_storage;129 std::aligned_storage_t<sizeof(T), std::alignment_of<T>::value> m_storage; 130 130 131 131 template<typename PtrType, bool ShouldRelax = std::is_base_of<RefCountedBase, PtrType>::value> struct MaybeRelax { -
trunk/Source/WTF/wtf/OptionSet.h
r213169 r223316 39 39 template<typename T> class OptionSet { 40 40 static_assert(std::is_enum<T>::value, "T is not an enum type"); 41 typedef typename std::make_unsigned<typename std::underlying_type<T>::type>::type StorageType;41 using StorageType = std::make_unsigned_t<std::underlying_type_t<T>>; 42 42 43 43 public: -
trunk/Source/WTF/wtf/RetainPtr.h
r222928 r223316 58 58 template<typename T> class RetainPtr { 59 59 public: 60 typedef typename std::remove_pointer<T>::typeValueType;60 typedef std::remove_pointer_t<T> ValueType; 61 61 typedef ValueType* PtrType; 62 62 typedef CFTypeRef StorageType; … … 114 114 #if defined (__OBJC__) && __has_feature(objc_arc) 115 115 template<typename U> 116 typename std::enable_if<std::is_convertible<U, id>::value, PtrType>::type 117 fromStorageTypeHelper(StorageType ptr) const 116 auto fromStorageTypeHelper(StorageType ptr) const -> std::enable_if_t<std::is_convertible<U, id>::value, PtrType> 118 117 { 119 118 return (__bridge PtrType)ptr; … … 121 120 122 121 template<typename U> 123 typename std::enable_if<!std::is_convertible<U, id>::value, PtrType>::type 124 fromStorageTypeHelper(StorageType ptr) const 122 auto fromStorageTypeHelper(StorageType ptr) const -> std::enable_if_t<!std::is_convertible<U, id>::value, PtrType> 125 123 { 126 124 return (PtrType)ptr; -
trunk/Source/WTF/wtf/SizeLimits.cpp
r216839 r223316 71 71 struct SameSizeAsVectorWithInlineCapacity { 72 72 SameSizeAsVectorWithInlineCapacity<T, 0> baseCapacity; 73 typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::typeinlineBuffer[inlineCapacity];73 std::aligned_storage_t<sizeof(T), std::alignment_of<T>::value> inlineBuffer[inlineCapacity]; 74 74 }; 75 75 -
trunk/Source/WTF/wtf/StdLibExtras.h
r223002 r223316 149 149 static_assert(__is_trivially_copyable(FromType), "bitwise_cast of non-trivially-copyable type!"); 150 150 #endif 151 typename std::remove_const<ToType>::typeto { };151 std::remove_const_t<ToType> to { }; 152 152 std::memcpy(&to, &from, sizeof(to)); 153 153 return to; … … 403 403 static std::false_type test(void*); 404 404 405 static constexpr const bool value = decltype(test(std::declval< typename std::remove_cv<Derived>::type*>()))::value;405 static constexpr const bool value = decltype(test(std::declval<std::remove_cv_t<Derived>*>()))::value; 406 406 }; 407 407 } … … 412 412 template <class T> 413 413 struct RemoveCVAndReference { 414 typedef typename std::remove_cv<typename std::remove_reference<T>::type>::typetype;414 typedef std::remove_cv_t<std::remove_reference_t<T>> type; 415 415 }; 416 416 … … 488 488 make_unique(size_t n) 489 489 { 490 typedef typename remove_extent<T>::typeU;490 typedef remove_extent_t<T> U; 491 491 return unique_ptr<T>(new U[n]()); 492 492 } … … 507 507 508 508 template<WTF::CheckMoveParameterTag, typename T> 509 ALWAYS_INLINE constexpr typename remove_reference<T>::type&& move(T&& value)509 ALWAYS_INLINE constexpr remove_reference_t<T>&& move(T&& value) 510 510 { 511 511 static_assert(is_lvalue_reference<T>::value, "T is not an lvalue reference; move() is unnecessary."); 512 512 513 using NonRefQualifiedType = typename remove_reference<T>::type;513 using NonRefQualifiedType = remove_reference_t<T>; 514 514 static_assert(!is_const<NonRefQualifiedType>::value, "T is const qualified."); 515 515 -
trunk/Source/WTF/wtf/SystemFree.h
r215715 r223316 34 34 void operator()(T* pointer) const 35 35 { 36 free(const_cast< typename std::remove_cv<T>::type*>(pointer));36 free(const_cast<std::remove_cv_t<T>*>(pointer)); 37 37 } 38 38 }; … … 42 42 void operator()(T* pointer) const 43 43 { 44 free(const_cast< typename std::remove_cv<T>::type*>(pointer));44 free(const_cast<std::remove_cv_t<T>*>(pointer)); 45 45 } 46 46 -
trunk/Source/WTF/wtf/ThreadSpecific.h
r220548 r223316 94 94 WTF_MAKE_FAST_ALLOCATED; 95 95 public: 96 using PointerType = typename std::remove_const<T>::type*;96 using PointerType = std::remove_const_t<T>*; 97 97 98 98 Data(ThreadSpecific<T, canBeGCThread>* owner) … … 113 113 PointerType storagePointer() const { return const_cast<PointerType>(reinterpret_cast<const T*>(&m_storage)); } 114 114 115 typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::typem_storage;115 std::aligned_storage_t<sizeof(T), std::alignment_of<T>::value> m_storage; 116 116 ThreadSpecific<T, canBeGCThread>* owner; 117 117 }; -
trunk/Source/WTF/wtf/TypeCasts.h
r201205 r223316 70 70 template <typename Reference, typename T> 71 71 struct match_constness { 72 typedef typename std::conditional<std::is_const<Reference>::value, typename std::add_const<T>::type, typename std::remove_const<T>::type>::typetype;72 typedef std::conditional_t<std::is_const<Reference>::value, std::add_const_t<T>, std::remove_const_t<T>> type; 73 73 }; 74 75 template <typename Reference, typename T> using match_constness_t = typename match_constness<Reference, T>::type; 74 76 75 77 // Safe downcasting functions. 76 78 template<typename Target, typename Source> 77 inline typename match_constness<Source, Target>::type& downcast(Source& source)79 inline match_constness_t<Source, Target>& downcast(Source& source) 78 80 { 79 81 static_assert(!std::is_same<Source, Target>::value, "Unnecessary cast to same type"); 80 82 static_assert(std::is_base_of<Source, Target>::value, "Should be a downcast"); 81 83 ASSERT_WITH_SECURITY_IMPLICATION(is<Target>(source)); 82 return static_cast< typename match_constness<Source, Target>::type&>(source);84 return static_cast<match_constness_t<Source, Target>&>(source); 83 85 } 84 86 template<typename Target, typename Source> 85 inline typename match_constness<Source, Target>::type* downcast(Source* source)87 inline match_constness_t<Source, Target>* downcast(Source* source) 86 88 { 87 89 static_assert(!std::is_same<Source, Target>::value, "Unnecessary cast to same type"); 88 90 static_assert(std::is_base_of<Source, Target>::value, "Should be a downcast"); 89 91 ASSERT_WITH_SECURITY_IMPLICATION(!source || is<Target>(*source)); 90 return static_cast< typename match_constness<Source, Target>::type*>(source);92 return static_cast<match_constness_t<Source, Target>*>(source); 91 93 } 92 94 -
trunk/Source/WTF/wtf/Vector.h
r223238 r223316 564 564 static const size_t asanInlineBufferAlignment = std::alignment_of<T>::value >= 8 ? std::alignment_of<T>::value : 8; 565 565 static const size_t asanAdjustedInlineCapacity = ((sizeof(T) * inlineCapacity + 7) & ~7) / sizeof(T); 566 typename std::aligned_storage<sizeof(T), asanInlineBufferAlignment>::typem_inlineBuffer[asanAdjustedInlineCapacity];566 std::aligned_storage_t<sizeof(T), asanInlineBufferAlignment> m_inlineBuffer[asanAdjustedInlineCapacity]; 567 567 #else 568 typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::typem_inlineBuffer[inlineCapacity];568 std::aligned_storage_t<sizeof(T), std::alignment_of<T>::value> m_inlineBuffer[inlineCapacity]; 569 569 #endif 570 570 }; … … 796 796 void checkConsistency(); 797 797 798 template<typename MapFunction, typename R = typename std::result_of<MapFunction(const T&)>::type> Vector<R> map(MapFunction) const;798 template<typename MapFunction, typename R = std::result_of_t<MapFunction(const T&)>> Vector<R> map(MapFunction) const; 799 799 800 800 private: … … 1306 1306 ASSERT(size() == capacity()); 1307 1307 1308 auto ptr = const_cast< typename std::remove_const<typename std::remove_reference<U>::type>::type*>(std::addressof(value));1308 auto ptr = const_cast<std::remove_const_t<std::remove_reference_t<U>>*>(std::addressof(value)); 1309 1309 ptr = expandCapacity(size() + 1, ptr); 1310 1310 ASSERT(begin()); … … 1392 1392 ASSERT_WITH_SECURITY_IMPLICATION(position <= size()); 1393 1393 1394 auto ptr = const_cast< typename std::remove_const<typename std::remove_reference<U>::type>::type*>(std::addressof(value));1394 auto ptr = const_cast<std::remove_const_t<std::remove_reference_t<U>>*>(std::addressof(value)); 1395 1395 if (size() == capacity()) { 1396 1396 ptr = expandCapacity(size() + 1, ptr); … … 1592 1592 template<typename SourceType> 1593 1593 struct CollectionInspector { 1594 using RealSourceType = typename std::remove_reference<SourceType>::type;1594 using RealSourceType = std::remove_reference_t<SourceType>; 1595 1595 using IteratorType = decltype(std::begin(std::declval<RealSourceType>())); 1596 1596 using SourceItemType = typename std::iterator_traits<IteratorType>::value_type; … … 1600 1600 struct Mapper { 1601 1601 using SourceItemType = typename CollectionInspector<SourceType>::SourceItemType; 1602 using DestinationItemType = typename std::result_of<MapFunction(SourceItemType&)>::type;1602 using DestinationItemType = std::result_of_t<MapFunction(SourceItemType&)>; 1603 1603 1604 1604 static Vector<DestinationItemType> map(SourceType source, const MapFunction& mapFunction) … … 1614 1614 1615 1615 template<typename MapFunction, typename SourceType> 1616 struct Mapper<MapFunction, SourceType, typename std::enable_if<std::is_rvalue_reference<SourceType&&>::value>::type> {1616 struct Mapper<MapFunction, SourceType, std::enable_if_t<std::is_rvalue_reference<SourceType&&>::value>> { 1617 1617 using SourceItemType = typename CollectionInspector<SourceType>::SourceItemType; 1618 using DestinationItemType = typename std::result_of<MapFunction(SourceItemType&&)>::type;1618 using DestinationItemType = std::result_of_t<MapFunction(SourceItemType&&)>; 1619 1619 1620 1620 static Vector<DestinationItemType> map(SourceType&& source, const MapFunction& mapFunction) … … 1654 1654 template<typename Collection> 1655 1655 struct CopyToVectorResult { 1656 using Type = typename std::remove_cv<typename CollectionInspector<Collection>::SourceItemType>::type;1656 using Type = std::remove_cv_t<typename CollectionInspector<Collection>::SourceItemType>; 1657 1657 }; 1658 1658 -
trunk/Source/WTF/wtf/text/IntegerToStringConversion.h
r217860 r223316 54 54 { 55 55 if (number < 0) 56 return numberToStringImpl<T, typename std::make_unsigned<SignedIntegerType>::type, NegativeNumber>(-number, additionalArgument);57 return numberToStringImpl<T, typename std::make_unsigned<SignedIntegerType>::type, PositiveNumber>(number, additionalArgument);56 return numberToStringImpl<T, std::make_unsigned_t<SignedIntegerType>, NegativeNumber>(-number, additionalArgument); 57 return numberToStringImpl<T, std::make_unsigned_t<SignedIntegerType>, PositiveNumber>(number, additionalArgument); 58 58 } 59 59 … … 88 88 { 89 89 if (number < 0) 90 return writeNumberToBufferImpl<CharacterType, typename std::make_unsigned<SignedIntegerType>::type, NegativeNumber>(-number, destination);91 return writeNumberToBufferImpl<CharacterType, typename std::make_unsigned<SignedIntegerType>::type, PositiveNumber>(number, destination);90 return writeNumberToBufferImpl<CharacterType, std::make_unsigned_t<SignedIntegerType>, NegativeNumber>(-number, destination); 91 return writeNumberToBufferImpl<CharacterType, std::make_unsigned_t<SignedIntegerType>, PositiveNumber>(number, destination); 92 92 } 93 93 … … 119 119 { 120 120 if (number < 0) 121 return lengthOfNumberAsStringImpl< typename std::make_unsigned<SignedIntegerType>::type, NegativeNumber>(-number);122 return lengthOfNumberAsStringImpl< typename std::make_unsigned<SignedIntegerType>::type, PositiveNumber>(number);121 return lengthOfNumberAsStringImpl<std::make_unsigned_t<SignedIntegerType>, NegativeNumber>(-number); 122 return lengthOfNumberAsStringImpl<std::make_unsigned_t<SignedIntegerType>, PositiveNumber>(number); 123 123 } 124 124
Note: See TracChangeset
for help on using the changeset viewer.