[libcxx-commits] [PATCH] D100686: [libc++][nfc] Move iterator_traits and related into __iterator/iterator_traits.h.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Apr 18 02:16:38 PDT 2021


Mordante accepted this revision as: Mordante.
Mordante added a comment.

LGTM assuming fixing the CI only requires include fixes.



================
Comment at: libcxx/include/__iterator/iterator_traits.h:14
+#include <__config>
+#include <concepts>
+
----------------
Quuxplusone wrote:
> Mordante wrote:
> > Are we expecting `<concepts>` to include `<type_traits>`?
> Yes. Everything includes `<type_traits>`; that's kind of an invariant of libc++.
> However, if this file needs something out of `<type_traits>`, it's good practice to Include What You Use, preferably with a comment. E.g.
> ```
> #include <type_traits> // declval
> ```
Fair point, but I disagree with the comment part. Unless it's a real surprise I dislike these comments since they tend to get outdated quickly.
A good example is `<array>` it includes `<cstdlib>` to use `_LIBCPP_UNREACHABLE`. It seems that macro is in that specific header since it may result in `abort()` which is in `<cstdlib>`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100686/new/

https://reviews.llvm.org/D100686



More information about the libcxx-commits mailing list