[libcxx-commits] [libcxx] [libc++] P2165R4: Update deduction guides for map containers and container adaptors (PR #136011)
via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Apr 19 12:07:31 PDT 2025
================
@@ -466,6 +467,18 @@ using __has_exactly_bidirectional_iterator_category _LIBCPP_NODEBUG =
template <class _InputIterator>
using __iter_value_type _LIBCPP_NODEBUG = typename iterator_traits<_InputIterator>::value_type;
+#if _LIBCPP_STD_VER >= 23
+template <class _InputIterator>
+using __iter_key_type _LIBCPP_NODEBUG = __remove_const_t<tuple_element_t<0, __iter_value_type<_InputIterator>>>;
----------------
KSARK wrote:
Thanks, @philnik777! Good point. For consistency with the original definition (which also used `__remove_const_t` - see https://github.com/llvm/llvm-project/blob/0ed1c9862df408d3df171762bd8fa0dafbe1b7e2/libcxx/include/__iterator/iterator_traits.h#L469-L471), and since @frederick-vs-ja verified the usage context of these internal aliases is correct per the standard, I'd prefer to keep it as is.
https://github.com/llvm/llvm-project/pull/136011
More information about the libcxx-commits
mailing list