[libcxx-commits] [PATCH] D105585: [libcxx][nfc] Remove <algorithm>'s dependence on <iterator> and related changes.
Arthur O'Dwyer via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Jul 7 13:17:21 PDT 2021
Quuxplusone added a subscriber: EricWF.
Quuxplusone added inline comments.
================
Comment at: libcxx/include/__algorithm/equal.h:16
#include <__iterator/iterator_traits.h>
-#include <iterator> // FIXME: replace with <__iterator/distance.h> when it lands
+#include <__iterator/distance.h>
----------------
a-z plz
================
Comment at: libcxx/include/__algorithm/is_permutation.h:17
#include <__iterator/next.h>
-#include <iterator> // FIXME: replace with <__iterator/distance.h> when it lands
+#include <__iterator/distance.h>
----------------
a-z plz (and throughout, anywhere I missed)
================
Comment at: libcxx/include/__functional/function.h:22
#include <exception>
-#include <memory> // TODO: replace with <__memory/__builtin_new_allocator.h>
+#include <__memory/builtin_new_allocator.h>
#include <type_traits>
----------------
a-z plz
================
Comment at: libcxx/include/algorithm:655
#include <initializer_list>
#include <utility> // needed to provide swap_ranges.
#include <type_traits>
----------------
This line is duplicated (see below in a-z order)
================
Comment at: libcxx/include/array:116
#include <cstdlib> // for _LIBCPP_UNREACHABLE
-#include <iterator>
+#include <__iterator/reverse_iterator.h>
#include <stdexcept>
----------------
a-z plz
================
Comment at: libcxx/include/functional:518
#include <exception>
-#include <memory>
#include <tuple>
----------------
As @EricWF and @ldionne (and I) have said, removing user-visible inclusions really ought to be done in separate commits and advertised. If we're breaking
```
#include <functional>
std::unique_ptr<int> p;
```
then that needs to be advertised somehow before we do it. Or discussed. Or something. (I mean, we just keep churning these headers — I'm sure we've broken many things already — but expect to keep hearing the same old squeaky wheels until the churn stops.)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D105585/new/
https://reviews.llvm.org/D105585
More information about the libcxx-commits
mailing list