Changeset 223316 in webkit


Ignore:
Timestamp:
Oct 13, 2017 9:45:20 PM (6 years ago)
Author:
commit-queue@webkit.org
Message:

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

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

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

  • wtf/Atomics.h:
  • wtf/CagedUniquePtr.h:
  • wtf/CheckedArithmetic.h:
  • wtf/CompletionHandler.h:
  • wtf/Function.h:
  • wtf/HashCountedSet.h:
  • wtf/HashFunctions.h:
  • wtf/HashMap.h:
  • wtf/HashSet.h:
  • wtf/HashTable.h:
  • wtf/HashTraits.h:
  • wtf/IndexedContainerIterator.h:
  • wtf/IteratorAdaptors.h:
  • wtf/KeyValuePair.h:
  • wtf/LEBDecoder.h:
  • wtf/ListHashSet.h:
  • wtf/MathExtras.h:
  • wtf/NeverDestroyed.h:
  • wtf/OptionSet.h:
  • wtf/RetainPtr.h:
  • wtf/SizeLimits.cpp:
  • wtf/StdLibExtras.h:
  • wtf/SystemFree.h:
  • wtf/ThreadSpecific.h:
  • wtf/TypeCasts.h:
  • wtf/Vector.h:
  • wtf/text/IntegerToStringConversion.h:
Location:
trunk/Source/WTF
Files:
28 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r223315 r223316  
     12017-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
    1392017-10-13  Jer Noble  <jer.noble@apple.com>
    240
  • trunk/Source/WTF/wtf/Atomics.h

    r217722 r223316  
    347347}
    348348
    349 template <typename T, typename std::enable_if<sizeof(T) == 8>::type* = nullptr>
     349template <typename T, std::enable_if_t<sizeof(T) == 8>* = nullptr>
    350350ALWAYS_INLINE Dependency dependency(T value)
    351351{
     
    380380// FIXME: This code is almost identical to the other dependency() overload.
    381381// https://bugs.webkit.org/show_bug.cgi?id=169405
    382 template <typename T, typename std::enable_if<sizeof(T) == 4>::type* = nullptr>
     382template <typename T, std::enable_if_t<sizeof(T) == 4>* = nullptr>
    383383ALWAYS_INLINE Dependency dependency(T value)
    384384{
     
    401401}
    402402
    403 template <typename T, typename std::enable_if<sizeof(T) == 2>::type* = nullptr>
     403template <typename T, std::enable_if_t<sizeof(T) == 2>* = nullptr>
    404404ALWAYS_INLINE Dependency dependency(T value)
    405405{
     
    407407}
    408408
    409 template <typename T, typename std::enable_if<sizeof(T) == 1>::type* = nullptr>
     409template <typename T, std::enable_if_t<sizeof(T) == 1>* = nullptr>
    410410ALWAYS_INLINE Dependency dependency(T value)
    411411{
  • trunk/Source/WTF/wtf/CagedUniquePtr.h

    r220712 r223316  
    8080
    8181template<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> {
     82class CagedUniquePtr<kind, T[], std::enable_if_t<std::is_trivially_destructible<T>::value>> : public CagedPtr<kind, T> {
    8383public:
    8484    CagedUniquePtr() : CagedPtr<kind, T>() { }
     
    131131
    132132template<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> {
     133class CagedUniquePtr<kind, T[], std::enable_if_t<!std::is_trivially_destructible<T>::value>> : public CagedPtr<kind, T> {
    134134public:
    135135    CagedUniquePtr() : CagedPtr<kind, T>() { }
  • trunk/Source/WTF/wtf/CheckedArithmetic.h

    r195298 r223316  
    144144        // When converting value to unsigned Source, value will become a big value if value is negative.
    145145        // 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();
    147147    }
    148148};
  • trunk/Source/WTF/wtf/CompletionHandler.h

    r221059 r223316  
    3838    CompletionHandler() = default;
    3939
    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>>
    4141    CompletionHandler(CallableType&& callable)
    4242        : m_function(WTFMove(callable))
  • trunk/Source/WTF/wtf/Function.h

    r220601 r223316  
    3939    Function(std::nullptr_t) { }
    4040
    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>>
    4242    Function(CallableType&& callable)
    4343        : m_callableWrapper(std::make_unique<CallableWrapper<CallableType>>(WTFMove(callable)))
     
    4545    }
    4646
    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>>
    4848    Function(FunctionType f)
    4949        : m_callableWrapper(std::make_unique<CallableWrapper<FunctionType>>(WTFMove(f)))
     
    5959    explicit operator bool() const { return !!m_callableWrapper; }
    6060
    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>>
    6262    Function& operator=(CallableType&& callable)
    6363    {
     
    6666    }
    6767
    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>>
    6969    Function& operator=(FunctionType f)
    7070    {
  • trunk/Source/WTF/wtf/HashCountedSet.h

    r223258 r223316  
    102102
    103103    // 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>::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);
     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);
    109109
    110110private:
     
    277277template<typename Value, typename HashFunctions, typename Traits>
    278278template<typename V>
    279 inline auto HashCountedSet<Value, HashFunctions, Traits>::find(typename GetPtrHelper<V>::PtrType value) -> typename std::enable_if<IsSmartPtr<V>::value, iterator>::type
     279inline auto HashCountedSet<Value, HashFunctions, Traits>::find(typename GetPtrHelper<V>::PtrType value) -> std::enable_if_t<IsSmartPtr<V>::value, iterator>
    280280{
    281281    return m_impl.find(value);
     
    284284template<typename Value, typename HashFunctions, typename Traits>
    285285template<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>::type
     286inline auto HashCountedSet<Value, HashFunctions, Traits>::find(typename GetPtrHelper<V>::PtrType value) const -> std::enable_if_t<IsSmartPtr<V>::value, const_iterator>
    287287{
    288288    return m_impl.find(value);
     
    291291template<typename Value, typename HashFunctions, typename Traits>
    292292template<typename V>
    293 inline auto HashCountedSet<Value, HashFunctions, Traits>::contains(typename GetPtrHelper<V>::PtrType value) const -> typename std::enable_if<IsSmartPtr<V>::value, bool>::type
     293inline auto HashCountedSet<Value, HashFunctions, Traits>::contains(typename GetPtrHelper<V>::PtrType value) const -> std::enable_if_t<IsSmartPtr<V>::value, bool>
    294294{
    295295    return m_impl.contains(value);
     
    298298template<typename Value, typename HashFunctions, typename Traits>
    299299template<typename V>
    300 inline auto HashCountedSet<Value, HashFunctions, Traits>::count(typename GetPtrHelper<V>::PtrType value) const -> typename std::enable_if<IsSmartPtr<V>::value, unsigned>::type
     300inline auto HashCountedSet<Value, HashFunctions, Traits>::count(typename GetPtrHelper<V>::PtrType value) const -> std::enable_if_t<IsSmartPtr<V>::value, unsigned>
    301301{
    302302    return m_impl.get(value);
     
    305305template<typename Value, typename HashFunctions, typename Traits>
    306306template<typename V>
    307 inline auto HashCountedSet<Value, HashFunctions, Traits>::remove(typename GetPtrHelper<V>::PtrType value) -> typename std::enable_if<IsSmartPtr<V>::value, bool>::type
     307inline auto HashCountedSet<Value, HashFunctions, Traits>::remove(typename GetPtrHelper<V>::PtrType value) -> std::enable_if_t<IsSmartPtr<V>::value, bool>
    308308{
    309309    return remove(find(value));
  • trunk/Source/WTF/wtf/HashFunctions.h

    r212992 r223316  
    179179    struct TupleHash {
    180180        template<size_t I = 0>
    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;
     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...>>;
    184184            return pairIntHash(DefaultHash<IthTupleElementType>::Hash::hash(std::get<I>(t)), hash<I + 1>(t));
    185185        }
    186186
    187187        template<size_t I = 0>
    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;
     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...>>;
    191191            return DefaultHash<IthTupleElementType>::Hash::hash(std::get<I>(t));
    192192        }
    193193
    194194        template<size_t I = 0>
    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;
     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...>>;
    198198            return DefaultHash<IthTupleElementType>::Hash::equal(std::get<I>(a), std::get<I>(b)) && equal<I + 1>(a, b);
    199199        }
    200200
    201201        template<size_t I = 0>
    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;
     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...>>;
    205205            return DefaultHash<IthTupleElementType>::Hash::equal(std::get<I>(a), std::get<I>(b));
    206206        }
  • trunk/Source/WTF/wtf/HashMap.h

    r223266 r223316  
    161161
    162162    // 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>::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);
     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);
    170170
    171171    void checkConsistency() const;
     
    474474template<typename T, typename U, typename V, typename W, typename X>
    475475template<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>::type
     476inline auto HashMap<T, U, V, W, X>::find(typename GetPtrHelper<K>::PtrType key) -> std::enable_if_t<IsSmartPtr<K>::value, iterator>
    477477{
    478478    return m_impl.template find<HashMapTranslator<KeyValuePairTraits, HashFunctions>>(key);
     
    481481template<typename T, typename U, typename V, typename W, typename X>
    482482template<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>::type
     483inline auto HashMap<T, U, V, W, X>::find(typename GetPtrHelper<K>::PtrType key) const -> std::enable_if_t<IsSmartPtr<K>::value, const_iterator>
    484484{
    485485    return m_impl.template find<HashMapTranslator<KeyValuePairTraits, HashFunctions>>(key);
     
    488488template<typename T, typename U, typename V, typename W, typename X>
    489489template<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>::type
     490inline auto HashMap<T, U, V, W, X>::contains(typename GetPtrHelper<K>::PtrType key) const -> std::enable_if_t<IsSmartPtr<K>::value, bool>
    491491{
    492492    return m_impl.template contains<HashMapTranslator<KeyValuePairTraits, HashFunctions>>(key);
     
    495495template<typename T, typename U, typename V, typename W, typename X>
    496496template<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>::type
     497inline auto HashMap<T, U, V, W, X>::inlineGet(typename GetPtrHelper<K>::PtrType key) const -> std::enable_if_t<IsSmartPtr<K>::value, MappedPeekType>
    498498{
    499499    KeyValuePairType* entry = const_cast<HashTableType&>(m_impl).template inlineLookup<HashMapTranslator<KeyValuePairTraits, HashFunctions>>(key);
     
    505505template<typename T, typename U, typename V, typename W, typename X>
    506506template<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>::type
     507auto HashMap<T, U, V, W, X>::get(typename GetPtrHelper<K>::PtrType key) const -> std::enable_if_t<IsSmartPtr<K>::value, MappedPeekType>
    508508{
    509509    return inlineGet(key);
     
    512512template<typename T, typename U, typename V, typename W, typename X>
    513513template<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>::type
     514inline auto HashMap<T, U, V, W, X>::remove(typename GetPtrHelper<K>::PtrType key) -> std::enable_if_t<IsSmartPtr<K>::value, bool>
    515515{
    516516    return remove(find(key));
     
    519519template<typename T, typename U, typename V, typename W, typename X>
    520520template<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>::type
     521inline auto HashMap<T, U, V, W, X>::take(typename GetPtrHelper<K>::PtrType key) -> std::enable_if_t<IsSmartPtr<K>::value, MappedTakeType>
    522522{
    523523    iterator it = find(key);
  • trunk/Source/WTF/wtf/HashSet.h

    r223266 r223316  
    3535    WTF_MAKE_FAST_ALLOCATED;
    3636private:
    37     typedef HashArg HashFunctions;
    38     typedef TraitsArg ValueTraits;
    39     typedef typename ValueTraits::TakeType TakeType;
     37    using HashFunctions = HashArg;
     38    using ValueTraits = TraitsArg;
     39    using TakeType = typename ValueTraits::TakeType;
    4040
    4141public:
    42     typedef typename ValueTraits::TraitType ValueType;
     42    using ValueType = typename ValueTraits::TraitType;
    4343
    4444private:
    45     typedef HashTable<ValueType, ValueType, IdentityExtractor,
    46         HashFunctions, ValueTraits, ValueTraits> HashTableType;
     45    using HashTableType = HashTable<ValueType, ValueType, IdentityExtractor, HashFunctions, ValueTraits, ValueTraits>;
    4746
    4847public:
    49     typedef HashTableConstIteratorAdapter<HashTableType, ValueType> iterator;
    50     typedef HashTableConstIteratorAdapter<HashTableType, ValueType> const_iterator;
    51     typedef typename HashTableType::AddResult AddResult;
     48    using iterator = HashTableConstIteratorAdapter<HashTableType, ValueType>;
     49    using const_iterator = HashTableConstIteratorAdapter<HashTableType, ValueType>;
     50    using AddResult= typename HashTableType::AddResult;
    5251
    5352    HashSet()
     
    114113
    115114    // 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>::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);
     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);
    120119
    121120    static bool isValidValue(const ValueType&);
     
    312311template<typename Value, typename HashFunctions, typename Traits>
    313312template<typename V>
    314 inline auto HashSet<Value, HashFunctions, Traits>::find(typename GetPtrHelper<V>::PtrType value) const -> typename std::enable_if<IsSmartPtr<V>::value, iterator>::type
     313inline auto HashSet<Value, HashFunctions, Traits>::find(typename GetPtrHelper<V>::PtrType value) const -> std::enable_if_t<IsSmartPtr<V>::value, iterator>
    315314{
    316315    return m_impl.template find<HashSetTranslator<Traits, HashFunctions>>(value);
     
    319318template<typename Value, typename HashFunctions, typename Traits>
    320319template<typename V>
    321 inline auto HashSet<Value, HashFunctions, Traits>::contains(typename GetPtrHelper<V>::PtrType value) const -> typename std::enable_if<IsSmartPtr<V>::value, bool>::type
     320inline auto HashSet<Value, HashFunctions, Traits>::contains(typename GetPtrHelper<V>::PtrType value) const -> std::enable_if_t<IsSmartPtr<V>::value, bool>
    322321{
    323322    return m_impl.template contains<HashSetTranslator<Traits, HashFunctions>>(value);
     
    326325template<typename Value, typename HashFunctions, typename Traits>
    327326template<typename V>
    328 inline auto HashSet<Value, HashFunctions, Traits>::remove(typename GetPtrHelper<V>::PtrType value) -> typename std::enable_if<IsSmartPtr<V>::value, bool>::type
     327inline auto HashSet<Value, HashFunctions, Traits>::remove(typename GetPtrHelper<V>::PtrType value) -> std::enable_if_t<IsSmartPtr<V>::value, bool>
    329328{
    330329    return remove(find(value));
     
    333332template<typename Value, typename HashFunctions, typename Traits>
    334333template<typename V>
    335 inline auto HashSet<Value, HashFunctions, Traits>::take(typename GetPtrHelper<V>::PtrType value) -> typename std::enable_if<IsSmartPtr<V>::value, TakeType>::type
     334inline auto HashSet<Value, HashFunctions, Traits>::take(typename GetPtrHelper<V>::PtrType value) -> std::enable_if_t<IsSmartPtr<V>::value, TakeType>
    336335{
    337336    return take(find(value));
  • trunk/Source/WTF/wtf/HashTable.h

    r214299 r223316  
    106106    class HashTableConstIterator : public std::iterator<std::forward_iterator_tag, Value, std::ptrdiff_t, const Value*, const Value&> {
    107107    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*;
    114114
    115115        friend class HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>;
     
    242242    class HashTableIterator : public std::iterator<std::forward_iterator_tag, Value, std::ptrdiff_t, Value*, Value&> {
    243243    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*;
    250250
    251251        friend class HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>;
     
    301301    class HashTable {
    302302    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>;
    310310
    311311#if DUMP_HASHTABLE_STATS_PER_TABLE
     
    434434        static void deallocateTable(ValueType* table, unsigned size);
    435435
    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>;
    438438
    439439        LookupType lookupForWriting(const Key& key) { return lookupForWriting<IdentityTranslatorType>(key); };
     
    586586            return;
    587587        ASSERT(!HashTranslator::equal(KeyTraits::emptyValue(), key));
    588         typename std::aligned_storage<sizeof(ValueType), std::alignment_of<ValueType>::value>::type deletedValueBuffer;
     588        std::aligned_storage_t<sizeof(ValueType), std::alignment_of<ValueType>::value> deletedValueBuffer;
    589589        ValueType* deletedValuePtr = reinterpret_cast_ptr<ValueType*>(&deletedValueBuffer);
    590590        ValueType& deletedValue = *deletedValuePtr;
  • trunk/Source/WTF/wtf/HashTraits.h

    r221914 r223316  
    106106// Can be used with strong enums, allows zero as key.
    107107template<typename T> struct StrongEnumHashTraits : GenericHashTraits<T> {
    108     using UnderlyingType = typename std::underlying_type<T>::type;
     108    using UnderlyingType = std::underlying_type_t<T>;
    109109    static const bool emptyValueIsZero = false;
    110110    static T emptyValue() { return static_cast<T>(std::numeric_limits<UnderlyingType>::max()); }
     
    225225
    226226template<typename Traits, typename T>
    227 typename std::enable_if<HashTraitHasCustomDelete<Traits, T>::value>::type
    228 hashTraitsDeleteBucket(T& value)
     227auto hashTraitsDeleteBucket(T& value) -> std::enable_if_t<HashTraitHasCustomDelete<Traits, T>::value>
    229228{
    230229    Traits::customDeleteBucket(value);
     
    232231
    233232template<typename Traits, typename T>
    234 typename std::enable_if<!HashTraitHasCustomDelete<Traits, T>::value>::type
    235 hashTraitsDeleteBucket(T& value)
     233auto hashTraitsDeleteBucket(T& value) -> std::enable_if_t<!HashTraitHasCustomDelete<Traits, T>::value>
    236234{
    237235    value.~T();
  • trunk/Source/WTF/wtf/IndexedContainerIterator.h

    r204920 r223316  
    4545    }
    4646
    47     auto operator*() -> typename std::result_of<decltype(&Container::at)(const Container, unsigned)>::type
     47    auto operator*() -> std::result_of_t<decltype(&Container::at)(const Container, unsigned)>
    4848    {
    4949        return m_container->at(m_index);
  • trunk/Source/WTF/wtf/IteratorAdaptors.h

    r194496 r223316  
    5353    }
    5454
    55     const typename std::remove_const<decltype(*std::declval<Iterator>())>::type operator*() const
     55    const std::remove_const_t<decltype(*std::declval<Iterator>())> operator*() const
    5656    {
    5757        ASSERT(m_iter != m_end);
     
    9090    }
    9191
    92     const typename std::remove_const<decltype(std::declval<Transform>()(*std::declval<Iterator>()))>::type operator*() const
     92    const std::remove_const_t<decltype(std::declval<Transform>()(*std::declval<Iterator>()))> operator*() const
    9393    {
    9494        return m_transform(*m_iter);
  • trunk/Source/WTF/wtf/KeyValuePair.h

    r221914 r223316  
    5858
    5959template<typename K, typename V>
    60 inline KeyValuePair<typename std::decay<K>::type, typename std::decay<V>::type> makeKeyValuePair(K&& key, V&& value)
     60inline KeyValuePair<std::decay_t<K>, std::decay_t<V>> makeKeyValuePair(K&& key, V&& value)
    6161{
    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) };
    6363}
    6464
  • trunk/Source/WTF/wtf/LEBDecoder.h

    r220562 r223316  
    8080    }
    8181
    82     using UnsignedT = typename std::make_unsigned<T>::type;
     82    using UnsignedT = std::make_unsigned_t<T>;
    8383    if (shift < numBits && (byte & 0x40))
    8484        result = static_cast<T>(static_cast<UnsignedT>(result) | (static_cast<UnsignedT>(-1) << shift));
  • trunk/Source/WTF/wtf/ListHashSet.h

    r223041 r223316  
    4949    WTF_MAKE_FAST_ALLOCATED;
    5050private:
    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;
    5858
    5959public:
    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>;
    6464    friend class ListHashSetConstIterator<ValueType, HashArg>;
    6565
    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>;
    7070
    7171    ListHashSet() = default;
     
    178178template<typename ValueArg, typename HashArg> class ListHashSetIterator {
    179179private:
    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;
    185185
    186186    friend class ListHashSet<ValueArg, HashArg>;
     
    189189
    190190public:
    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;
    196196
    197197    ListHashSetIterator() { }
     
    225225template<typename ValueArg, typename HashArg> class ListHashSetConstIterator {
    226226private:
    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;
    232232
    233233    friend class ListHashSet<ValueArg, HashArg>;
     
    241241
    242242public:
    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;
    248248
    249249    ListHashSetConstIterator()
  • trunk/Source/WTF/wtf/MathExtras.h

    r221600 r223316  
    210210template <typename T> inline unsigned getLSBSet(T value)
    211211{
    212     typedef typename std::make_unsigned<T>::type UnsignedT;
     212    typedef std::make_unsigned_t<T> UnsignedT;
    213213    unsigned result = 0;
    214214
     
    374374
    375375template <typename T>
    376 inline typename std::enable_if<std::is_floating_point<T>::value, T>::type safeFPDivision(T u, T v)
     376inline std::enable_if_t<std::is_floating_point<T>::value, T> safeFPDivision(T u, T v)
    377377{
    378378    // Protect against overflow / underflow.
     
    391391// [2] http://www.boost.org/doc/libs/1_34_0/libs/test/doc/components/test_tools/floating_point_comparison.html
    392392template <typename T>
    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())
     393inline std::enable_if_t<std::is_floating_point<T>::value, bool> areEssentiallyEqual(T u, T v, T epsilon = std::numeric_limits<T>::epsilon())
    394394{
    395395    if (u == v)
     
    402402// Match behavior of Math.min, where NaN is returned if either argument is NaN.
    403403template <typename T>
    404 inline typename std::enable_if<std::is_floating_point<T>::value, T>::type nanPropagatingMin(T a, T b)
     404inline std::enable_if_t<std::is_floating_point<T>::value, T> nanPropagatingMin(T a, T b)
    405405{
    406406    return std::isnan(a) || std::isnan(b) ? std::numeric_limits<T>::quiet_NaN() : std::min(a, b);
     
    409409// Match behavior of Math.max, where NaN is returned if either argument is NaN.
    410410template <typename T>
    411 inline typename std::enable_if<std::is_floating_point<T>::value, T>::type nanPropagatingMax(T a, T b)
     411inline std::enable_if_t<std::is_floating_point<T>::value, T> nanPropagatingMax(T a, T b)
    412412{
    413413    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  
    6363
    6464private:
    65     using PointerType = typename std::remove_const<T>::type*;
     65    using PointerType = std::remove_const_t<T>*;
    6666
    6767    PointerType storagePointer() const { return const_cast<PointerType>(reinterpret_cast<const T*>(&m_storage)); }
     
    6969    // FIXME: Investigate whether we should allocate a hunk of virtual memory
    7070    // and hand out chunks of it to NeverDestroyed instead, to reduce fragmentation.
    71     typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::type m_storage;
     71    std::aligned_storage_t<sizeof(T), std::alignment_of<T>::value> m_storage;
    7272
    7373    template<typename PtrType, bool ShouldRelax = std::is_base_of<RefCountedBase, PtrType>::value> struct MaybeRelax {
     
    117117
    118118private:
    119     using PointerType = typename std::remove_const<T>::type*;
     119    using PointerType = std::remove_const_t<T>*;
    120120
    121121    PointerType storagePointer() const
     
    127127    // FIXME: Investigate whether we should allocate a hunk of virtual memory
    128128    // and hand out chunks of it to NeverDestroyed instead, to reduce fragmentation.
    129     typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::type m_storage;
     129    std::aligned_storage_t<sizeof(T), std::alignment_of<T>::value> m_storage;
    130130
    131131    template<typename PtrType, bool ShouldRelax = std::is_base_of<RefCountedBase, PtrType>::value> struct MaybeRelax {
  • trunk/Source/WTF/wtf/OptionSet.h

    r213169 r223316  
    3939template<typename T> class OptionSet {
    4040    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>>;
    4242
    4343public:
  • trunk/Source/WTF/wtf/RetainPtr.h

    r222928 r223316  
    5858template<typename T> class RetainPtr {
    5959public:
    60     typedef typename std::remove_pointer<T>::type ValueType;
     60    typedef std::remove_pointer_t<T> ValueType;
    6161    typedef ValueType* PtrType;
    6262    typedef CFTypeRef StorageType;
     
    114114#if defined (__OBJC__) && __has_feature(objc_arc)
    115115    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>
    118117    {
    119118        return (__bridge PtrType)ptr;
     
    121120
    122121    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>
    125123    {
    126124        return (PtrType)ptr;
  • trunk/Source/WTF/wtf/SizeLimits.cpp

    r216839 r223316  
    7171struct SameSizeAsVectorWithInlineCapacity {
    7272    SameSizeAsVectorWithInlineCapacity<T, 0> baseCapacity;
    73     typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::type inlineBuffer[inlineCapacity];
     73    std::aligned_storage_t<sizeof(T), std::alignment_of<T>::value> inlineBuffer[inlineCapacity];
    7474};
    7575
  • trunk/Source/WTF/wtf/StdLibExtras.h

    r223002 r223316  
    149149    static_assert(__is_trivially_copyable(FromType), "bitwise_cast of non-trivially-copyable type!");
    150150#endif
    151     typename std::remove_const<ToType>::type to { };
     151    std::remove_const_t<ToType> to { };
    152152    std::memcpy(&to, &from, sizeof(to));
    153153    return to;
     
    403403        static std::false_type test(void*);
    404404
    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;
    406406    };
    407407}
     
    412412template <class T>
    413413struct RemoveCVAndReference  {
    414     typedef typename std::remove_cv<typename std::remove_reference<T>::type>::type type;
     414    typedef std::remove_cv_t<std::remove_reference_t<T>> type;
    415415};
    416416
     
    488488make_unique(size_t n)
    489489{
    490     typedef typename remove_extent<T>::type U;
     490    typedef remove_extent_t<T> U;
    491491    return unique_ptr<T>(new U[n]());
    492492}
     
    507507
    508508template<WTF::CheckMoveParameterTag, typename T>
    509 ALWAYS_INLINE constexpr typename remove_reference<T>::type&& move(T&& value)
     509ALWAYS_INLINE constexpr remove_reference_t<T>&& move(T&& value)
    510510{
    511511    static_assert(is_lvalue_reference<T>::value, "T is not an lvalue reference; move() is unnecessary.");
    512512
    513     using NonRefQualifiedType = typename remove_reference<T>::type;
     513    using NonRefQualifiedType = remove_reference_t<T>;
    514514    static_assert(!is_const<NonRefQualifiedType>::value, "T is const qualified.");
    515515
  • trunk/Source/WTF/wtf/SystemFree.h

    r215715 r223316  
    3434    void operator()(T* pointer) const
    3535    {
    36         free(const_cast<typename std::remove_cv<T>::type*>(pointer));
     36        free(const_cast<std::remove_cv_t<T>*>(pointer));
    3737    }
    3838};
     
    4242    void operator()(T* pointer) const
    4343    {
    44         free(const_cast<typename std::remove_cv<T>::type*>(pointer));
     44        free(const_cast<std::remove_cv_t<T>*>(pointer));
    4545    }
    4646
  • trunk/Source/WTF/wtf/ThreadSpecific.h

    r220548 r223316  
    9494        WTF_MAKE_FAST_ALLOCATED;
    9595    public:
    96         using PointerType = typename std::remove_const<T>::type*;
     96        using PointerType = std::remove_const_t<T>*;
    9797
    9898        Data(ThreadSpecific<T, canBeGCThread>* owner)
     
    113113        PointerType storagePointer() const { return const_cast<PointerType>(reinterpret_cast<const T*>(&m_storage)); }
    114114
    115         typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::type m_storage;
     115        std::aligned_storage_t<sizeof(T), std::alignment_of<T>::value> m_storage;
    116116        ThreadSpecific<T, canBeGCThread>* owner;
    117117    };
  • trunk/Source/WTF/wtf/TypeCasts.h

    r201205 r223316  
    7070template <typename Reference, typename T>
    7171struct match_constness {
    72     typedef typename std::conditional<std::is_const<Reference>::value, typename std::add_const<T>::type, typename std::remove_const<T>::type>::type type;
     72    typedef std::conditional_t<std::is_const<Reference>::value, std::add_const_t<T>, std::remove_const_t<T>> type;
    7373};
     74
     75template <typename Reference, typename T> using match_constness_t = typename match_constness<Reference, T>::type;
    7476
    7577// Safe downcasting functions.
    7678template<typename Target, typename Source>
    77 inline typename match_constness<Source, Target>::type& downcast(Source& source)
     79inline match_constness_t<Source, Target>& downcast(Source& source)
    7880{
    7981    static_assert(!std::is_same<Source, Target>::value, "Unnecessary cast to same type");
    8082    static_assert(std::is_base_of<Source, Target>::value, "Should be a downcast");
    8183    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);
    8385}
    8486template<typename Target, typename Source>
    85 inline typename match_constness<Source, Target>::type* downcast(Source* source)
     87inline match_constness_t<Source, Target>* downcast(Source* source)
    8688{
    8789    static_assert(!std::is_same<Source, Target>::value, "Unnecessary cast to same type");
    8890    static_assert(std::is_base_of<Source, Target>::value, "Should be a downcast");
    8991    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);
    9193}
    9294
  • trunk/Source/WTF/wtf/Vector.h

    r223238 r223316  
    564564    static const size_t asanInlineBufferAlignment = std::alignment_of<T>::value >= 8 ? std::alignment_of<T>::value : 8;
    565565    static const size_t asanAdjustedInlineCapacity = ((sizeof(T) * inlineCapacity + 7) & ~7) / sizeof(T);
    566     typename std::aligned_storage<sizeof(T), asanInlineBufferAlignment>::type m_inlineBuffer[asanAdjustedInlineCapacity];
     566    std::aligned_storage_t<sizeof(T), asanInlineBufferAlignment> m_inlineBuffer[asanAdjustedInlineCapacity];
    567567#else
    568     typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::type m_inlineBuffer[inlineCapacity];
     568    std::aligned_storage_t<sizeof(T), std::alignment_of<T>::value> m_inlineBuffer[inlineCapacity];
    569569#endif
    570570};
     
    796796    void checkConsistency();
    797797
    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;
    799799
    800800private:
     
    13061306    ASSERT(size() == capacity());
    13071307
    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));
    13091309    ptr = expandCapacity(size() + 1, ptr);
    13101310    ASSERT(begin());
     
    13921392    ASSERT_WITH_SECURITY_IMPLICATION(position <= size());
    13931393
    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));
    13951395    if (size() == capacity()) {
    13961396        ptr = expandCapacity(size() + 1, ptr);
     
    15921592template<typename SourceType>
    15931593struct CollectionInspector {
    1594     using RealSourceType = typename std::remove_reference<SourceType>::type;
     1594    using RealSourceType = std::remove_reference_t<SourceType>;
    15951595    using IteratorType = decltype(std::begin(std::declval<RealSourceType>()));
    15961596    using SourceItemType = typename std::iterator_traits<IteratorType>::value_type;
     
    16001600struct Mapper {
    16011601    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&)>;
    16031603
    16041604    static Vector<DestinationItemType> map(SourceType source, const MapFunction& mapFunction)
     
    16141614
    16151615template<typename MapFunction, typename SourceType>
    1616 struct Mapper<MapFunction, SourceType, typename std::enable_if<std::is_rvalue_reference<SourceType&&>::value>::type> {
     1616struct Mapper<MapFunction, SourceType, std::enable_if_t<std::is_rvalue_reference<SourceType&&>::value>> {
    16171617    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&&)>;
    16191619
    16201620    static Vector<DestinationItemType> map(SourceType&& source, const MapFunction& mapFunction)
     
    16541654template<typename Collection>
    16551655struct CopyToVectorResult {
    1656     using Type = typename std::remove_cv<typename CollectionInspector<Collection>::SourceItemType>::type;
     1656    using Type = std::remove_cv_t<typename CollectionInspector<Collection>::SourceItemType>;
    16571657};
    16581658
  • trunk/Source/WTF/wtf/text/IntegerToStringConversion.h

    r217860 r223316  
    5454{
    5555    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);
    5858}
    5959
     
    8888{
    8989    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);
    9292}
    9393
     
    119119{
    120120    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);
    123123}
    124124
Note: See TracChangeset for help on using the changeset viewer.