Skip to content

[libc++] P2165R4: Update deduction guides for map containers and container adaptors #135351

@frederick-vs-ja

Description

@frederick-vs-ja

Link: https://wg21.link/P2165R4

The following alias templates needs to be defined differently since C++23.

template <class _InputIterator>
using __iter_key_type _LIBCPP_NODEBUG =
__remove_const_t<typename iterator_traits<_InputIterator>::value_type::first_type>;
template <class _InputIterator>
using __iter_mapped_type _LIBCPP_NODEBUG = typename iterator_traits<_InputIterator>::value_type::second_type;
template <class _InputIterator>
using __iter_to_alloc_type _LIBCPP_NODEBUG =
pair<const typename iterator_traits<_InputIterator>::value_type::first_type,
typename iterator_traits<_InputIterator>::value_type::second_type>;

After changing this alias templates, it should be tested that class template argument deduction (for map, multimap, unordered_map, unordered_multimap, flat_map, and flat_multimap) actually works with tuple-like types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    c++23libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions