public:
using iterator_category = input_iterator_tag;
using iterator_concept = random_access_iterator_tag;
- using value_type = pair<const key_type, mapped_type>;
+ using value_type = pair<key_type, mapped_type>;
using reference = pair<const key_type&,
ranges::__maybe_const_t<_Const, mapped_type>&>;
using difference_type = ptrdiff_t;
m[k] = 0;
}
+void
+test09()
+{
+ // PR libstdc++/122921 - The value_type of flat_map's iterator should be
+ // pair<Key, T> instead of pair<const Key, T>
+ using type = std::flat_map<int, int>;
+ using value_type = std::ranges::range_value_t<type>;
+ using value_type = type::value_type;
+ using value_type = std::pair<int, int>;
+}
+
int
main()
{
test06();
test07();
test08();
+ test09();
}
VERIFY( std::ranges::equal(m, (std::pair<int,int>[]){{3,4},{3,3}}) );
}
+void
+test09()
+{
+ // PR libstdc++/122921 - The value_type of flat_map's iterator should be
+ // pair<Key, T> instead of pair<const Key, T>
+ using type = std::flat_multimap<int, int>;
+ using value_type = std::ranges::range_value_t<type>;
+ using value_type = type::value_type;
+ using value_type = std::pair<int, int>;
+}
+
int
main()
{
test05();
test06();
test07();
+ test09();
}