[libcxx-commits] [PATCH] D99855: [libcxx] makes `iterator_traits` C++20-aware
Tim Song via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Apr 7 18:51:10 PDT 2021
tcanens added inline comments.
================
Comment at: libcxx/include/iterator:740
+template<__specifies_members _Ip>
+struct _LIBCPP_TEMPLATE_VIS iterator_traits<_Ip> {
+ using iterator_category = typename _Ip::iterator_category;
----------------
I think all of these cases need to be routed through a base class template from which `iterator_traits` derives. "Primary template" means "primary template"; if I specialize `iterator_traits` for my types, it must not create an ambiguity with these specializations, even if I write my specialization like
```
template<class I>
requires is_my_iterator<I>
struct std::iterator_traits<I>{
// ...
};
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D99855/new/
https://reviews.llvm.org/D99855
More information about the libcxx-commits
mailing list