[libcxx-commits] [libcxx] [libc++] Merge the private iterator_traits aliases with their ranges versions (PR #162661)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Oct 15 08:44:02 PDT 2025
================
@@ -71,15 +65,9 @@ struct _ClassicAlgPolicy {};
template <>
struct _IterOps<_ClassicAlgPolicy> {
- template <class _Iter>
- using __value_type _LIBCPP_NODEBUG = typename iterator_traits<_Iter>::value_type;
----------------
ldionne wrote:
Now, the question is whether we actually care about these differences.
I think we don't care about the specialization stuff. We should get those clarified with a LWG issue, but I have no sympathy for someone who has different `It::difference_type` and `incrementable_traits<It>::difference_type` through a specialization. Same for `It::value_type`.
However, the case of legacy output iterators could be a real problem. However, we basically never use `iterator_traits<It>::value_type` for an output iterator since it may be `void`. So in practice this might not matter.
I'll wait for @frederick-vs-ja to chime in, but so far I think I'd be comfortable with making this change. However, this would have to be dry-run on large code bases (we can ping the Google folks and we'll also do an internal build when we're ready), to shake off any unintended consequences.
https://github.com/llvm/llvm-project/pull/162661
More information about the libcxx-commits
mailing list