[libcxx-commits] [libcxx] 9807626 - [libc++] Include <__iterator/distance.h> instead of <iterator> in a few algorithm headers

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri Aug 20 12:02:38 PDT 2021


Author: Joe Loser
Date: 2021-08-20T15:02:33-04:00
New Revision: 9807626bc721a2330758c449548e89913f1826af

URL: https://github.com/llvm/llvm-project/commit/9807626bc721a2330758c449548e89913f1826af
DIFF: https://github.com/llvm/llvm-project/commit/9807626bc721a2330758c449548e89913f1826af.diff

LOG: [libc++] Include <__iterator/distance.h> instead of <iterator> in a few algorithm headers

A few headers in algorithm include `<iterator>` when
`<__iterator/distance.h>` would suffice. Change them
to just include `<__iterator.distance.h>`.

Differential Revision: https://reviews.llvm.org/D108393

Added: 
    

Modified: 
    libcxx/include/__algorithm/equal.h
    libcxx/include/__algorithm/is_permutation.h

Removed: 
    


################################################################################
diff  --git a/libcxx/include/__algorithm/equal.h b/libcxx/include/__algorithm/equal.h
index bc67559819634..2f47fc83a10de 100644
--- a/libcxx/include/__algorithm/equal.h
+++ b/libcxx/include/__algorithm/equal.h
@@ -12,8 +12,9 @@
 
 #include <__config>
 #include <__algorithm/comp.h>
+#include <__iterator/distance.h>
 #include <__iterator/iterator_traits.h>
-#include <iterator> // FIXME: replace with <__iterator/distance.h> when it lands
+#include <type_traits>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header

diff  --git a/libcxx/include/__algorithm/is_permutation.h b/libcxx/include/__algorithm/is_permutation.h
index 0545eb76370a4..e33a7157ddca7 100644
--- a/libcxx/include/__algorithm/is_permutation.h
+++ b/libcxx/include/__algorithm/is_permutation.h
@@ -12,9 +12,10 @@
 
 #include <__algorithm/comp.h>
 #include <__config>
+#include <__iterator/distance.h>
 #include <__iterator/iterator_traits.h>
 #include <__iterator/next.h>
-#include <iterator> // FIXME: replace with <__iterator/distance.h> when it lands
+#include <type_traits>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header


        


More information about the libcxx-commits mailing list