[libcxx-commits] [PATCH] D99855: [libcxx] makes `iterator_traits` C++20-aware
Christopher Di Bella via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Apr 19 09:15:29 PDT 2021
cjdb added inline comments.
================
Comment at: libcxx/include/iterator:702-707
+ __has_member_reference<_Ip> &&
+ __has_member_iterator_category<_Ip> &&
+ requires {
+ typename _Ip::difference_type;
+ typename _Ip::value_type;
+ };
----------------
zoecarver wrote:
> cjdb wrote:
> > I know I wrote this, but it'd be better if we used nested requires expressions so the requirements can be congruently ordered with the wording.
> Not sure I follow. Do you want me to make this two `requires` expressions, or do you want me to add `__has_member_{difference_type,value_type}`?
```
requires {
typename _Ip::value_type;
typename _Ip::difference_type;
requires __has_member_reference<_Ip>; // this is a nested-requires-expression
requires __has_member_iterator_category<_Ip>;
};
```
However, you did point out that the ordering of wording is subject to change, so perhaps this is a moot point to discuss.
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