Changeset 246670 in webkit


Ignore:
Timestamp:
Jun 20, 2019 10:19:27 PM (5 years ago)
Author:
Fujii Hironori
Message:

Try to use C++14 std::enable_if_t in CheckedArithmetic.h again
https://bugs.webkit.org/show_bug.cgi?id=199099

Reviewed by Ross Kirsling.

r242235 changed CheckedArithmetic to not use C++14. Let's try
C++14 again.

  • wtf/CheckedArithmetic.h: Use C++14 std::make_unsigned_t and std::enable_if_t.
Location:
trunk/Source/WTF
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r246636 r246670  
     12019-06-20  Fujii Hironori  <Hironori.Fujii@sony.com>
     2
     3        Try to use C++14 std::enable_if_t in CheckedArithmetic.h again
     4        https://bugs.webkit.org/show_bug.cgi?id=199099
     5
     6        Reviewed by Ross Kirsling.
     7
     8        r242235 changed CheckedArithmetic to not use C++14. Let's try
     9        C++14 again.
     10
     11        * wtf/CheckedArithmetic.h: Use C++14 std::make_unsigned_t and std::enable_if_t.
     12
    1132019-06-18  Darin Adler  <darin@apple.com>
    214
  • trunk/Source/WTF/wtf/CheckedArithmetic.h

    r243163 r246670  
    182182        // When converting value to unsigned Source, value will become a big value if value is negative.
    183183        // Casted value will become bigger than Target::max as Source is bigger than Target.
    184         return static_cast<typename std::make_unsigned<Source>::type>(value) <= std::numeric_limits<Target>::max();
     184        return static_cast<std::make_unsigned_t<Source>>(value) <= std::numeric_limits<Target>::max();
    185185    }
    186186};
     
    542542};
    543543
    544 template <class OverflowHandler, typename = typename std::enable_if<!std::is_scalar<OverflowHandler>::value>::type>
     544template <class OverflowHandler, typename = std::enable_if_t<!std::is_scalar<OverflowHandler>::value>>
    545545inline constexpr bool observesOverflow() { return true; }
    546546
     
    554554}
    555555
    556 template <class OverflowHandler, typename U, typename V, typename R, typename = typename std::enable_if<!std::is_scalar<OverflowHandler>::value>::type>
     556template <class OverflowHandler, typename U, typename V, typename R, typename = std::enable_if_t<!std::is_scalar<OverflowHandler>::value>>
    557557static inline bool safeAdd(U lhs, V rhs, R& result)
    558558{
     
    568568}
    569569
    570 template <class OverflowHandler, typename U, typename V, typename R, typename = typename std::enable_if<!std::is_scalar<OverflowHandler>::value>::type>
     570template <class OverflowHandler, typename U, typename V, typename R, typename = std::enable_if_t<!std::is_scalar<OverflowHandler>::value>>
    571571static inline bool safeSub(U lhs, V rhs, R& result)
    572572{
     
    582582}
    583583
    584 template <class OverflowHandler, typename U, typename V, typename R, typename = typename std::enable_if<!std::is_scalar<OverflowHandler>::value>::type>
     584template <class OverflowHandler, typename U, typename V, typename R, typename = std::enable_if_t<!std::is_scalar<OverflowHandler>::value>>
    585585static inline bool safeMultiply(U lhs, V rhs, R& result)
    586586{
Note: See TracChangeset for help on using the changeset viewer.