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

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Apr 17 08:26:44 PDT 2021


Quuxplusone added inline comments.


================
Comment at: libcxx/include/__iterator/iterator_traits.h:14
+#include <__config>
+#include <concepts>
+
----------------
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
```


================
Comment at: libcxx/include/iterator:416
 #include <compare>
 #include <concepts>
 #include <cstddef>
----------------
Mordante wrote:
> The new header includes `<concepts>`. What's our policy for including this header here too? I would prefer to remove it.
Include What You Use. If this file uses something out of `<concepts>`, it should include `<concepts>`, preferably with a comment. However, in this case, the inclusion is actually mandated by the Standard! so we should probably comment to that effect.
```
#include <concepts> // mandated
```


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