Changeset 246670 in webkit
- Timestamp:
- Jun 20, 2019 10:19:27 PM (5 years ago)
- Location:
- trunk/Source/WTF
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r246636 r246670 1 2019-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 1 13 2019-06-18 Darin Adler <darin@apple.com> 2 14 -
trunk/Source/WTF/wtf/CheckedArithmetic.h
r243163 r246670 182 182 // When converting value to unsigned Source, value will become a big value if value is negative. 183 183 // 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(); 185 185 } 186 186 }; … … 542 542 }; 543 543 544 template <class OverflowHandler, typename = typename std::enable_if<!std::is_scalar<OverflowHandler>::value>::type>544 template <class OverflowHandler, typename = std::enable_if_t<!std::is_scalar<OverflowHandler>::value>> 545 545 inline constexpr bool observesOverflow() { return true; } 546 546 … … 554 554 } 555 555 556 template <class OverflowHandler, typename U, typename V, typename R, typename = typename std::enable_if<!std::is_scalar<OverflowHandler>::value>::type>556 template <class OverflowHandler, typename U, typename V, typename R, typename = std::enable_if_t<!std::is_scalar<OverflowHandler>::value>> 557 557 static inline bool safeAdd(U lhs, V rhs, R& result) 558 558 { … … 568 568 } 569 569 570 template <class OverflowHandler, typename U, typename V, typename R, typename = typename std::enable_if<!std::is_scalar<OverflowHandler>::value>::type>570 template <class OverflowHandler, typename U, typename V, typename R, typename = std::enable_if_t<!std::is_scalar<OverflowHandler>::value>> 571 571 static inline bool safeSub(U lhs, V rhs, R& result) 572 572 { … … 582 582 } 583 583 584 template <class OverflowHandler, typename U, typename V, typename R, typename = typename std::enable_if<!std::is_scalar<OverflowHandler>::value>::type>584 template <class OverflowHandler, typename U, typename V, typename R, typename = std::enable_if_t<!std::is_scalar<OverflowHandler>::value>> 585 585 static inline bool safeMultiply(U lhs, V rhs, R& result) 586 586 {
Note: See TracChangeset
for help on using the changeset viewer.