[llvm] Use std::remove_const_t (NFC)
authorKazu Hirata <kazu@google.com>
Sat, 3 Sep 2022 18:17:45 +0000 (11:17 -0700)
committerKazu Hirata <kazu@google.com>
Sat, 3 Sep 2022 18:17:45 +0000 (11:17 -0700)
llvm/include/llvm/ADT/STLExtras.h
llvm/include/llvm/ADT/SmallVector.h

index 609534c..d12edd7 100644 (file)
@@ -784,9 +784,8 @@ auto deref_or_none(const Iter &I, const Iter &End) -> llvm::Optional<
 }
 
 template <typename Iter> struct ZipLongestItemType {
-  using type =
-      llvm::Optional<typename std::remove_const<typename std::remove_reference<
-          decltype(*std::declval<Iter>())>::type>::type>;
+  using type = llvm::Optional<std::remove_const_t<
+      typename std::remove_reference<decltype(*std::declval<Iter>())>::type>>;
 };
 
 template <typename... Iters> struct ZipLongestTupleType {
index 47a3035..fbb42ce 100644 (file)
@@ -497,8 +497,8 @@ protected:
   template <typename T1, typename T2>
   static void uninitialized_copy(
       T1 *I, T1 *E, T2 *Dest,
-      std::enable_if_t<std::is_same<typename std::remove_const<T1>::type,
-                                    T2>::value> * = nullptr) {
+      std::enable_if_t<std::is_same<std::remove_const_t<T1>, T2>::value> * =
+          nullptr) {
     // Use memcpy for PODs iterated by pointers (which includes SmallVector
     // iterators): std::uninitialized_copy optimizes to memmove, but we can
     // use memcpy here. Note that I and E are iterators and thus might be
@@ -1271,8 +1271,8 @@ inline size_t capacity_in_bytes(const SmallVector<T, N> &X) {
 
 template <typename RangeType>
 using ValueTypeFromRangeType =
-    typename std::remove_const<typename std::remove_reference<
-        decltype(*std::begin(std::declval<RangeType &>()))>::type>::type;
+    std::remove_const_t<typename std::remove_reference<decltype(*std::begin(
+        std::declval<RangeType &>()))>::type>;
 
 /// Given a range of type R, iterate the entire range and return a
 /// SmallVector with elements of the vector.  This is useful, for example,