Changeset 223617 in webkit
- Timestamp:
- Oct 18, 2017 11:23:09 AM (7 years ago)
- Location:
- trunk/Source/WTF/wtf
- Files:
-
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/wtf/Atomics.h
r223316 r223617 347 347 } 348 348 349 template <typename T, std::enable_if_t<sizeof(T) == 8>* = nullptr>349 template <typename T, typename std::enable_if<sizeof(T) == 8>::type* = 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, std::enable_if_t<sizeof(T) == 4>* = nullptr>382 template <typename T, typename std::enable_if<sizeof(T) == 4>::type* = nullptr> 383 383 ALWAYS_INLINE Dependency dependency(T value) 384 384 { … … 401 401 } 402 402 403 template <typename T, std::enable_if_t<sizeof(T) == 2>* = nullptr>403 template <typename T, typename std::enable_if<sizeof(T) == 2>::type* = nullptr> 404 404 ALWAYS_INLINE Dependency dependency(T value) 405 405 { … … 407 407 } 408 408 409 template <typename T, std::enable_if_t<sizeof(T) == 1>* = nullptr>409 template <typename T, typename std::enable_if<sizeof(T) == 1>::type* = nullptr> 410 410 ALWAYS_INLINE Dependency dependency(T value) 411 411 { -
trunk/Source/WTF/wtf/CagedUniquePtr.h
r223316 r223617 80 80 81 81 template<Gigacage::Kind kind, typename T> 82 class CagedUniquePtr<kind, T[], std::enable_if_t<std::is_trivially_destructible<T>::value>> : public CagedPtr<kind, T> {82 class CagedUniquePtr<kind, T[], typename std::enable_if<std::is_trivially_destructible<T>::value>::type> : 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[], std::enable_if_t<!std::is_trivially_destructible<T>::value>> : public CagedPtr<kind, T> {133 class CagedUniquePtr<kind, T[], typename std::enable_if<!std::is_trivially_destructible<T>::value>::type> : public CagedPtr<kind, T> { 134 134 public: 135 135 CagedUniquePtr() : CagedPtr<kind, T>() { } -
trunk/Source/WTF/wtf/CheckedArithmetic.h
r223316 r223617 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< std::make_unsigned_t<Source>>(value) <= std::numeric_limits<Target>::max();146 return static_cast<typename std::make_unsigned<Source>::type>(value) <= std::numeric_limits<Target>::max(); 147 147 } 148 148 }; -
trunk/Source/WTF/wtf/CompletionHandler.h
r223316 r223617 38 38 CompletionHandler() = default; 39 39 40 template<typename CallableType, class = std::enable_if_t<std::is_rvalue_reference<CallableType&&>::value>>40 template<typename CallableType, class = typename std::enable_if<std::is_rvalue_reference<CallableType&&>::value>::type> 41 41 CompletionHandler(CallableType&& callable) 42 42 : m_function(WTFMove(callable)) -
trunk/Source/WTF/wtf/Function.h
r223316 r223617 39 39 Function(std::nullptr_t) { } 40 40 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>>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> 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 = std::enable_if_t<std::is_pointer<FunctionType>::value && std::is_function<std::remove_pointer_t<FunctionType>>::value>>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> 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 = std::enable_if_t<!(std::is_pointer<CallableType>::value && std::is_function<std::remove_pointer_t<CallableType>>::value) && std::is_rvalue_reference<CallableType&&>::value>>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> 62 62 Function& operator=(CallableType&& callable) 63 63 { … … 66 66 } 67 67 68 template<typename FunctionType, class = std::enable_if_t<std::is_pointer<FunctionType>::value && std::is_function<std::remove_pointer_t<FunctionType>>::value>>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> 69 69 Function& operator=(FunctionType f) 70 70 { -
trunk/Source/WTF/wtf/HashCountedSet.h
r223317 r223617 102 102 103 103 // Overloads for smart pointer keys that take the raw pointer type as the parameter. 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);104 template<typename V = ValueType> typename std::enable_if<IsSmartPtr<V>::value, iterator>::type find(typename GetPtrHelper<V>::PtrType); 105 template<typename V = ValueType> typename std::enable_if<IsSmartPtr<V>::value, const_iterator>::type find(typename GetPtrHelper<V>::PtrType) const; 106 template<typename V = ValueType> typename std::enable_if<IsSmartPtr<V>::value, bool>::type contains(typename GetPtrHelper<V>::PtrType) const; 107 template<typename V = ValueType> typename std::enable_if<IsSmartPtr<V>::value, unsigned>::type count(typename GetPtrHelper<V>::PtrType) const; 108 template<typename V = ValueType> typename std::enable_if<IsSmartPtr<V>::value, bool>::type 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) -> std::enable_if_t<IsSmartPtr<V>::value, iterator>279 inline auto HashCountedSet<Value, HashFunctions, Traits>::find(typename GetPtrHelper<V>::PtrType value) -> typename std::enable_if<IsSmartPtr<V>::value, iterator>::type 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 -> std::enable_if_t<IsSmartPtr<V>::value, const_iterator>286 inline auto HashCountedSet<Value, HashFunctions, Traits>::find(typename GetPtrHelper<V>::PtrType value) const -> typename std::enable_if<IsSmartPtr<V>::value, const_iterator>::type 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 -> std::enable_if_t<IsSmartPtr<V>::value, bool>293 inline auto HashCountedSet<Value, HashFunctions, Traits>::contains(typename GetPtrHelper<V>::PtrType value) const -> typename std::enable_if<IsSmartPtr<V>::value, bool>::type 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 -> std::enable_if_t<IsSmartPtr<V>::value, unsigned>300 inline auto HashCountedSet<Value, HashFunctions, Traits>::count(typename GetPtrHelper<V>::PtrType value) const -> typename std::enable_if<IsSmartPtr<V>::value, unsigned>::type 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) -> std::enable_if_t<IsSmartPtr<V>::value, bool>307 inline auto HashCountedSet<Value, HashFunctions, Traits>::remove(typename GetPtrHelper<V>::PtrType value) -> typename std::enable_if<IsSmartPtr<V>::value, bool>::type 308 308 { 309 309 return remove(find(value)); -
trunk/Source/WTF/wtf/HashFunctions.h
r223316 r223617 179 179 struct TupleHash { 180 180 template<size_t I = 0> 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...>>;181 static typename std::enable_if<I < sizeof...(Types) - 1, unsigned>::type hash(const std::tuple<Types...>& t) 182 { 183 using IthTupleElementType = typename std::tuple_element<I, typename std::tuple<Types...>>::type; 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 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...>>;188 static typename std::enable_if<I == sizeof...(Types) - 1, unsigned>::type hash(const std::tuple<Types...>& t) 189 { 190 using IthTupleElementType = typename std::tuple_element<I, typename std::tuple<Types...>>::type; 191 191 return DefaultHash<IthTupleElementType>::Hash::hash(std::get<I>(t)); 192 192 } 193 193 194 194 template<size_t I = 0> 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...>>;195 static typename std::enable_if<I < sizeof...(Types) - 1, bool>::type equal(const std::tuple<Types...>& a, const std::tuple<Types...>& b) 196 { 197 using IthTupleElementType = typename std::tuple_element<I, typename std::tuple<Types...>>::type; 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 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...>>;202 static typename std::enable_if<I == sizeof...(Types) - 1, bool>::type equal(const std::tuple<Types...>& a, const std::tuple<Types...>& b) 203 { 204 using IthTupleElementType = typename std::tuple_element<I, typename std::tuple<Types...>>::type; 205 205 return DefaultHash<IthTupleElementType>::Hash::equal(std::get<I>(a), std::get<I>(b)); 206 206 } -
trunk/Source/WTF/wtf/HashMap.h
r223316 r223617 161 161 162 162 // Overloads for smart pointer keys that take the raw pointer type as the parameter. 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);163 template<typename K = KeyType> typename std::enable_if<IsSmartPtr<K>::value, iterator>::type find(typename GetPtrHelper<K>::PtrType); 164 template<typename K = KeyType> typename std::enable_if<IsSmartPtr<K>::value, const_iterator>::type find(typename GetPtrHelper<K>::PtrType) const; 165 template<typename K = KeyType> typename std::enable_if<IsSmartPtr<K>::value, bool>::type contains(typename GetPtrHelper<K>::PtrType) const; 166 template<typename K = KeyType> typename std::enable_if<IsSmartPtr<K>::value, MappedPeekType>::type inlineGet(typename GetPtrHelper<K>::PtrType) const; 167 template<typename K = KeyType> typename std::enable_if<IsSmartPtr<K>::value, MappedPeekType>::type get(typename GetPtrHelper<K>::PtrType) const; 168 template<typename K = KeyType> typename std::enable_if<IsSmartPtr<K>::value, bool>::type remove(typename GetPtrHelper<K>::PtrType); 169 template<typename K = KeyType> typename std::enable_if<IsSmartPtr<K>::value, MappedTakeType>::type 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) -> std::enable_if_t<IsSmartPtr<K>::value, iterator>476 inline auto HashMap<T, U, V, W, X>::find(typename GetPtrHelper<K>::PtrType key) -> typename std::enable_if<IsSmartPtr<K>::value, iterator>::type 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 -> std::enable_if_t<IsSmartPtr<K>::value, const_iterator>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>::type 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 -> std::enable_if_t<IsSmartPtr<K>::value, bool>490 inline auto HashMap<T, U, V, W, X>::contains(typename GetPtrHelper<K>::PtrType key) const -> typename std::enable_if<IsSmartPtr<K>::value, bool>::type 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 -> std::enable_if_t<IsSmartPtr<K>::value, MappedPeekType>497 inline auto HashMap<T, U, V, W, X>::inlineGet(typename GetPtrHelper<K>::PtrType key) const -> typename std::enable_if<IsSmartPtr<K>::value, MappedPeekType>::type 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 -> std::enable_if_t<IsSmartPtr<K>::value, MappedPeekType>507 auto HashMap<T, U, V, W, X>::get(typename GetPtrHelper<K>::PtrType key) const -> typename std::enable_if<IsSmartPtr<K>::value, MappedPeekType>::type 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) -> std::enable_if_t<IsSmartPtr<K>::value, bool>514 inline auto HashMap<T, U, V, W, X>::remove(typename GetPtrHelper<K>::PtrType key) -> typename std::enable_if<IsSmartPtr<K>::value, bool>::type 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) -> std::enable_if_t<IsSmartPtr<K>::value, MappedTakeType>521 inline auto HashMap<T, U, V, W, X>::take(typename GetPtrHelper<K>::PtrType key) -> typename std::enable_if<IsSmartPtr<K>::value, MappedTakeType>::type 522 522 { 523 523 iterator it = find(key); -
trunk/Source/WTF/wtf/HashSet.h
r223316 r223617 35 35 WTF_MAKE_FAST_ALLOCATED; 36 36 private: 37 using HashFunctions = HashArg;38 using ValueTraits = TraitsArg;39 using TakeType = typename ValueTraits::TakeType;37 typedef HashArg HashFunctions; 38 typedef TraitsArg ValueTraits; 39 typedef typename ValueTraits::TakeType TakeType; 40 40 41 41 public: 42 using ValueType = typename ValueTraits::TraitType;42 typedef typename ValueTraits::TraitType ValueType; 43 43 44 44 private: 45 using HashTableType = HashTable<ValueType, ValueType, IdentityExtractor, HashFunctions, ValueTraits, ValueTraits>; 45 typedef HashTable<ValueType, ValueType, IdentityExtractor, 46 HashFunctions, ValueTraits, ValueTraits> HashTableType; 46 47 47 48 public: 48 using iterator = HashTableConstIteratorAdapter<HashTableType, ValueType>;49 using const_iterator = HashTableConstIteratorAdapter<HashTableType, ValueType>;50 using AddResult= typename HashTableType::AddResult;49 typedef HashTableConstIteratorAdapter<HashTableType, ValueType> iterator; 50 typedef HashTableConstIteratorAdapter<HashTableType, ValueType> const_iterator; 51 typedef typename HashTableType::AddResult AddResult; 51 52 52 53 HashSet() … … 113 114 114 115 // Overloads for smart pointer values that take the raw pointer type as the parameter. 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);116 template<typename V = ValueType> typename std::enable_if<IsSmartPtr<V>::value, iterator>::type find(typename GetPtrHelper<V>::PtrType) const; 117 template<typename V = ValueType> typename std::enable_if<IsSmartPtr<V>::value, bool>::type contains(typename GetPtrHelper<V>::PtrType) const; 118 template<typename V = ValueType> typename std::enable_if<IsSmartPtr<V>::value, bool>::type remove(typename GetPtrHelper<V>::PtrType); 119 template<typename V = ValueType> typename std::enable_if<IsSmartPtr<V>::value, TakeType>::type take(typename GetPtrHelper<V>::PtrType); 119 120 120 121 static bool isValidValue(const ValueType&); … … 311 312 template<typename Value, typename HashFunctions, typename Traits> 312 313 template<typename V> 313 inline auto HashSet<Value, HashFunctions, Traits>::find(typename GetPtrHelper<V>::PtrType value) const -> std::enable_if_t<IsSmartPtr<V>::value, iterator>314 inline auto HashSet<Value, HashFunctions, Traits>::find(typename GetPtrHelper<V>::PtrType value) const -> typename std::enable_if<IsSmartPtr<V>::value, iterator>::type 314 315 { 315 316 return m_impl.template find<HashSetTranslator<Traits, HashFunctions>>(value); … … 318 319 template<typename Value, typename HashFunctions, typename Traits> 319 320 template<typename V> 320 inline auto HashSet<Value, HashFunctions, Traits>::contains(typename GetPtrHelper<V>::PtrType value) const -> std::enable_if_t<IsSmartPtr<V>::value, bool>321 inline auto HashSet<Value, HashFunctions, Traits>::contains(typename GetPtrHelper<V>::PtrType value) const -> typename std::enable_if<IsSmartPtr<V>::value, bool>::type 321 322 { 322 323 return m_impl.template contains<HashSetTranslator<Traits, HashFunctions>>(value); … … 325 326 template<typename Value, typename HashFunctions, typename Traits> 326 327 template<typename V> 327 inline auto HashSet<Value, HashFunctions, Traits>::remove(typename GetPtrHelper<V>::PtrType value) -> std::enable_if_t<IsSmartPtr<V>::value, bool>328 inline auto HashSet<Value, HashFunctions, Traits>::remove(typename GetPtrHelper<V>::PtrType value) -> typename std::enable_if<IsSmartPtr<V>::value, bool>::type 328 329 { 329 330 return remove(find(value)); … … 332 333 template<typename Value, typename HashFunctions, typename Traits> 333 334 template<typename V> 334 inline auto HashSet<Value, HashFunctions, Traits>::take(typename GetPtrHelper<V>::PtrType value) -> std::enable_if_t<IsSmartPtr<V>::value, TakeType>335 inline auto HashSet<Value, HashFunctions, Traits>::take(typename GetPtrHelper<V>::PtrType value) -> typename std::enable_if<IsSmartPtr<V>::value, TakeType>::type 335 336 { 336 337 return take(find(value)); -
trunk/Source/WTF/wtf/HashTable.h
r223316 r223617 106 106 class HashTableConstIterator : public std::iterator<std::forward_iterator_tag, Value, std::ptrdiff_t, const Value*, const Value&> { 107 107 private: 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*;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; 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 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*;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; 250 250 251 251 friend class HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>; … … 301 301 class HashTable { 302 302 public: 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>;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; 310 310 311 311 #if DUMP_HASHTABLE_STATS_PER_TABLE … … 434 434 static void deallocateTable(ValueType* table, unsigned size); 435 435 436 using LookupType = std::pair<ValueType*, bool>;437 using FullLookupType = std::pair<LookupType, unsigned>;436 typedef std::pair<ValueType*, bool> LookupType; 437 typedef std::pair<LookupType, unsigned> FullLookupType; 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 std::aligned_storage_t<sizeof(ValueType), std::alignment_of<ValueType>::value>deletedValueBuffer;588 typename std::aligned_storage<sizeof(ValueType), std::alignment_of<ValueType>::value>::type deletedValueBuffer; 589 589 ValueType* deletedValuePtr = reinterpret_cast_ptr<ValueType*>(&deletedValueBuffer); 590 590 ValueType& deletedValue = *deletedValuePtr; -
trunk/Source/WTF/wtf/HashTraits.h
r223316 r223617 106 106 // Can be used with strong enums, allows zero as key. 107 107 template<typename T> struct StrongEnumHashTraits : GenericHashTraits<T> { 108 using UnderlyingType = std::underlying_type_t<T>;108 using UnderlyingType = typename std::underlying_type<T>::type; 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 auto hashTraitsDeleteBucket(T& value) -> std::enable_if_t<HashTraitHasCustomDelete<Traits, T>::value> 227 typename std::enable_if<HashTraitHasCustomDelete<Traits, T>::value>::type 228 hashTraitsDeleteBucket(T& value) 228 229 { 229 230 Traits::customDeleteBucket(value); … … 231 232 232 233 template<typename Traits, typename T> 233 auto hashTraitsDeleteBucket(T& value) -> std::enable_if_t<!HashTraitHasCustomDelete<Traits, T>::value> 234 typename std::enable_if<!HashTraitHasCustomDelete<Traits, T>::value>::type 235 hashTraitsDeleteBucket(T& value) 234 236 { 235 237 value.~T(); -
trunk/Source/WTF/wtf/IndexedContainerIterator.h
r223316 r223617 45 45 } 46 46 47 auto operator*() -> std::result_of_t<decltype(&Container::at)(const Container, unsigned)>47 auto operator*() -> typename std::result_of<decltype(&Container::at)(const Container, unsigned)>::type 48 48 { 49 49 return m_container->at(m_index); -
trunk/Source/WTF/wtf/IteratorAdaptors.h
r223316 r223617 53 53 } 54 54 55 const std::remove_const_t<decltype(*std::declval<Iterator>())>operator*() const55 const typename std::remove_const<decltype(*std::declval<Iterator>())>::type operator*() const 56 56 { 57 57 ASSERT(m_iter != m_end); … … 90 90 } 91 91 92 const std::remove_const_t<decltype(std::declval<Transform>()(*std::declval<Iterator>()))>operator*() const92 const typename std::remove_const<decltype(std::declval<Transform>()(*std::declval<Iterator>()))>::type operator*() const 93 93 { 94 94 return m_transform(*m_iter); -
trunk/Source/WTF/wtf/KeyValuePair.h
r223316 r223617 58 58 59 59 template<typename K, typename V> 60 inline KeyValuePair< std::decay_t<K>, std::decay_t<V>> makeKeyValuePair(K&& key, V&& value)60 inline KeyValuePair<typename std::decay<K>::type, typename std::decay<V>::type> makeKeyValuePair(K&& key, V&& value) 61 61 { 62 return KeyValuePair< std::decay_t<K>, std::decay_t<V>> { std::forward<K>(key), std::forward<V>(value) };62 return KeyValuePair<typename std::decay<K>::type, typename std::decay<V>::type> { std::forward<K>(key), std::forward<V>(value) }; 63 63 } 64 64 -
trunk/Source/WTF/wtf/LEBDecoder.h
r223316 r223617 80 80 } 81 81 82 using UnsignedT = std::make_unsigned_t<T>;82 using UnsignedT = typename std::make_unsigned<T>::type; 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
r223316 r223617 49 49 WTF_MAKE_FAST_ALLOCATED; 50 50 private: 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;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; 58 58 59 59 public: 60 using ValueType = ValueArg;61 62 using iterator = ListHashSetIterator<ValueType, HashArg>;63 using const_iterator = ListHashSetConstIterator<ValueType, HashArg>;60 typedef ValueArg ValueType; 61 62 typedef ListHashSetIterator<ValueType, HashArg> iterator; 63 typedef ListHashSetConstIterator<ValueType, HashArg> const_iterator; 64 64 friend class ListHashSetConstIterator<ValueType, HashArg>; 65 65 66 using reverse_iterator = std::reverse_iterator<iterator>;67 using const_reverse_iterator = std::reverse_iterator<const_iterator>;68 69 using AddResult = HashTableAddResult<iterator>;66 typedef std::reverse_iterator<iterator> reverse_iterator; 67 typedef std::reverse_iterator<const_iterator> const_reverse_iterator; 68 69 typedef HashTableAddResult<iterator> AddResult; 70 70 71 71 ListHashSet() = default; … … 178 178 template<typename ValueArg, typename HashArg> class ListHashSetIterator { 179 179 private: 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;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; 185 185 186 186 friend class ListHashSet<ValueArg, HashArg>; … … 189 189 190 190 public: 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;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; 196 196 197 197 ListHashSetIterator() { } … … 225 225 template<typename ValueArg, typename HashArg> class ListHashSetConstIterator { 226 226 private: 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;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; 232 232 233 233 friend class ListHashSet<ValueArg, HashArg>; … … 241 241 242 242 public: 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;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; 248 248 249 249 ListHashSetConstIterator() -
trunk/Source/WTF/wtf/MathExtras.h
r223316 r223617 210 210 template <typename T> inline unsigned getLSBSet(T value) 211 211 { 212 typedef std::make_unsigned_t<T>UnsignedT;212 typedef typename std::make_unsigned<T>::type UnsignedT; 213 213 unsigned result = 0; 214 214 … … 374 374 375 375 template <typename T> 376 inline std::enable_if_t<std::is_floating_point<T>::value, T>safeFPDivision(T u, T v)376 inline typename std::enable_if<std::is_floating_point<T>::value, T>::type 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 std::enable_if_t<std::is_floating_point<T>::value, bool>areEssentiallyEqual(T u, T v, T epsilon = std::numeric_limits<T>::epsilon())393 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()) 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 std::enable_if_t<std::is_floating_point<T>::value, T>nanPropagatingMin(T a, T b)404 inline typename std::enable_if<std::is_floating_point<T>::value, T>::type 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 std::enable_if_t<std::is_floating_point<T>::value, T>nanPropagatingMax(T a, T b)411 inline typename std::enable_if<std::is_floating_point<T>::value, T>::type 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
r223316 r223617 63 63 64 64 private: 65 using PointerType = std::remove_const_t<T>*;65 using PointerType = typename std::remove_const<T>::type*; 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 std::aligned_storage_t<sizeof(T), std::alignment_of<T>::value>m_storage;71 typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::type 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 = std::remove_const_t<T>*;119 using PointerType = typename std::remove_const<T>::type*; 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 std::aligned_storage_t<sizeof(T), std::alignment_of<T>::value>m_storage;129 typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::type 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
r223316 r223617 39 39 template<typename T> class OptionSet { 40 40 static_assert(std::is_enum<T>::value, "T is not an enum type"); 41 using StorageType = std::make_unsigned_t<std::underlying_type_t<T>>;41 typedef typename std::make_unsigned<typename std::underlying_type<T>::type>::type StorageType; 42 42 43 43 public: -
trunk/Source/WTF/wtf/RetainPtr.h
r223316 r223617 58 58 template<typename T> class RetainPtr { 59 59 public: 60 typedef std::remove_pointer_t<T>ValueType;60 typedef typename std::remove_pointer<T>::type 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 auto fromStorageTypeHelper(StorageType ptr) const -> std::enable_if_t<std::is_convertible<U, id>::value, PtrType> 116 typename std::enable_if<std::is_convertible<U, id>::value, PtrType>::type 117 fromStorageTypeHelper(StorageType ptr) const 117 118 { 118 119 return (__bridge PtrType)ptr; … … 120 121 121 122 template<typename U> 122 auto fromStorageTypeHelper(StorageType ptr) const -> std::enable_if_t<!std::is_convertible<U, id>::value, PtrType> 123 typename std::enable_if<!std::is_convertible<U, id>::value, PtrType>::type 124 fromStorageTypeHelper(StorageType ptr) const 123 125 { 124 126 return (PtrType)ptr; -
trunk/Source/WTF/wtf/SizeLimits.cpp
r223316 r223617 71 71 struct SameSizeAsVectorWithInlineCapacity { 72 72 SameSizeAsVectorWithInlineCapacity<T, 0> baseCapacity; 73 std::aligned_storage_t<sizeof(T), std::alignment_of<T>::value>inlineBuffer[inlineCapacity];73 typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::type inlineBuffer[inlineCapacity]; 74 74 }; 75 75 -
trunk/Source/WTF/wtf/StdLibExtras.h
r223316 r223617 149 149 static_assert(__is_trivially_copyable(FromType), "bitwise_cast of non-trivially-copyable type!"); 150 150 #endif 151 std::remove_const_t<ToType>to { };151 typename std::remove_const<ToType>::type 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< std::remove_cv_t<Derived>*>()))::value;405 static constexpr const bool value = decltype(test(std::declval<typename std::remove_cv<Derived>::type*>()))::value; 406 406 }; 407 407 } … … 412 412 template <class T> 413 413 struct RemoveCVAndReference { 414 typedef std::remove_cv_t<std::remove_reference_t<T>>type;414 typedef typename std::remove_cv<typename std::remove_reference<T>::type>::type type; 415 415 }; 416 416 … … 488 488 make_unique(size_t n) 489 489 { 490 typedef remove_extent_t<T>U;490 typedef typename remove_extent<T>::type 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 remove_reference_t<T>&& move(T&& value)509 ALWAYS_INLINE constexpr typename remove_reference<T>::type&& 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 = remove_reference_t<T>;513 using NonRefQualifiedType = typename remove_reference<T>::type; 514 514 static_assert(!is_const<NonRefQualifiedType>::value, "T is const qualified."); 515 515 -
trunk/Source/WTF/wtf/SystemFree.h
r223316 r223617 34 34 void operator()(T* pointer) const 35 35 { 36 free(const_cast< std::remove_cv_t<T>*>(pointer));36 free(const_cast<typename std::remove_cv<T>::type*>(pointer)); 37 37 } 38 38 }; … … 42 42 void operator()(T* pointer) const 43 43 { 44 free(const_cast< std::remove_cv_t<T>*>(pointer));44 free(const_cast<typename std::remove_cv<T>::type*>(pointer)); 45 45 } 46 46 -
trunk/Source/WTF/wtf/ThreadSpecific.h
r223316 r223617 94 94 WTF_MAKE_FAST_ALLOCATED; 95 95 public: 96 using PointerType = std::remove_const_t<T>*;96 using PointerType = typename std::remove_const<T>::type*; 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 std::aligned_storage_t<sizeof(T), std::alignment_of<T>::value>m_storage;115 typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::type m_storage; 116 116 ThreadSpecific<T, canBeGCThread>* owner; 117 117 }; -
trunk/Source/WTF/wtf/TypeCasts.h
r223316 r223617 70 70 template <typename Reference, typename T> 71 71 struct match_constness { 72 typedef std::conditional_t<std::is_const<Reference>::value, std::add_const_t<T>, std::remove_const_t<T>>type;72 typedef typename std::conditional<std::is_const<Reference>::value, typename std::add_const<T>::type, typename std::remove_const<T>::type>::type type; 73 73 }; 74 75 template <typename Reference, typename T> using match_constness_t = typename match_constness<Reference, T>::type;76 74 77 75 // Safe downcasting functions. 78 76 template<typename Target, typename Source> 79 inline match_constness_t<Source, Target>& downcast(Source& source)77 inline typename match_constness<Source, Target>::type& downcast(Source& source) 80 78 { 81 79 static_assert(!std::is_same<Source, Target>::value, "Unnecessary cast to same type"); 82 80 static_assert(std::is_base_of<Source, Target>::value, "Should be a downcast"); 83 81 ASSERT_WITH_SECURITY_IMPLICATION(is<Target>(source)); 84 return static_cast< match_constness_t<Source, Target>&>(source);82 return static_cast<typename match_constness<Source, Target>::type&>(source); 85 83 } 86 84 template<typename Target, typename Source> 87 inline match_constness_t<Source, Target>* downcast(Source* source)85 inline typename match_constness<Source, Target>::type* downcast(Source* source) 88 86 { 89 87 static_assert(!std::is_same<Source, Target>::value, "Unnecessary cast to same type"); 90 88 static_assert(std::is_base_of<Source, Target>::value, "Should be a downcast"); 91 89 ASSERT_WITH_SECURITY_IMPLICATION(!source || is<Target>(*source)); 92 return static_cast< match_constness_t<Source, Target>*>(source);90 return static_cast<typename match_constness<Source, Target>::type*>(source); 93 91 } 94 92 -
trunk/Source/WTF/wtf/Vector.h
r223316 r223617 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 std::aligned_storage_t<sizeof(T), asanInlineBufferAlignment>m_inlineBuffer[asanAdjustedInlineCapacity];566 typename std::aligned_storage<sizeof(T), asanInlineBufferAlignment>::type m_inlineBuffer[asanAdjustedInlineCapacity]; 567 567 #else 568 std::aligned_storage_t<sizeof(T), std::alignment_of<T>::value>m_inlineBuffer[inlineCapacity];568 typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::type m_inlineBuffer[inlineCapacity]; 569 569 #endif 570 570 }; … … 796 796 void checkConsistency(); 797 797 798 template<typename MapFunction, typename R = std::result_of_t<MapFunction(const T&)>> Vector<R> map(MapFunction) const;798 template<typename MapFunction, typename R = typename std::result_of<MapFunction(const T&)>::type> Vector<R> map(MapFunction) const; 799 799 800 800 private: … … 1306 1306 ASSERT(size() == capacity()); 1307 1307 1308 auto ptr = const_cast< std::remove_const_t<std::remove_reference_t<U>>*>(std::addressof(value));1308 auto ptr = const_cast<typename std::remove_const<typename std::remove_reference<U>::type>::type*>(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< std::remove_const_t<std::remove_reference_t<U>>*>(std::addressof(value));1394 auto ptr = const_cast<typename std::remove_const<typename std::remove_reference<U>::type>::type*>(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 = std::remove_reference_t<SourceType>;1594 using RealSourceType = typename std::remove_reference<SourceType>::type; 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 = std::result_of_t<MapFunction(SourceItemType&)>;1602 using DestinationItemType = typename std::result_of<MapFunction(SourceItemType&)>::type; 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, std::enable_if_t<std::is_rvalue_reference<SourceType&&>::value>> {1616 struct Mapper<MapFunction, SourceType, typename std::enable_if<std::is_rvalue_reference<SourceType&&>::value>::type> { 1617 1617 using SourceItemType = typename CollectionInspector<SourceType>::SourceItemType; 1618 using DestinationItemType = std::result_of_t<MapFunction(SourceItemType&&)>;1618 using DestinationItemType = typename std::result_of<MapFunction(SourceItemType&&)>::type; 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 = std::remove_cv_t<typename CollectionInspector<Collection>::SourceItemType>;1656 using Type = typename std::remove_cv<typename CollectionInspector<Collection>::SourceItemType>::type; 1657 1657 }; 1658 1658 -
trunk/Source/WTF/wtf/text/IntegerToStringConversion.h
r223316 r223617 54 54 { 55 55 if (number < 0) 56 return numberToStringImpl<T, std::make_unsigned_t<SignedIntegerType>, NegativeNumber>(-number, additionalArgument);57 return numberToStringImpl<T, std::make_unsigned_t<SignedIntegerType>, PositiveNumber>(number, additionalArgument);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); 58 58 } 59 59 … … 88 88 { 89 89 if (number < 0) 90 return writeNumberToBufferImpl<CharacterType, std::make_unsigned_t<SignedIntegerType>, NegativeNumber>(-number, destination);91 return writeNumberToBufferImpl<CharacterType, std::make_unsigned_t<SignedIntegerType>, PositiveNumber>(number, destination);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); 92 92 } 93 93 … … 119 119 { 120 120 if (number < 0) 121 return lengthOfNumberAsStringImpl< std::make_unsigned_t<SignedIntegerType>, NegativeNumber>(-number);122 return lengthOfNumberAsStringImpl< std::make_unsigned_t<SignedIntegerType>, PositiveNumber>(number);121 return lengthOfNumberAsStringImpl<typename std::make_unsigned<SignedIntegerType>::type, NegativeNumber>(-number); 122 return lengthOfNumberAsStringImpl<typename std::make_unsigned<SignedIntegerType>::type, PositiveNumber>(number); 123 123 } 124 124
Note: See TracChangeset
for help on using the changeset viewer.