Created on 2022-09-25.00:00:00 last changed 13 months ago
Proposed resolution:
This wording is relative to N4917.
Modify [container.adaptors.general] as indicated:
-8- The following exposition-only alias template may appear in deduction guides for container adaptors:
template<class Allocator, class T> using alloc-rebind = // exposition only typename allocator_traits<Allocator>::template rebind_alloc<T>;
Modify [flat.map.defn], class template flat_map synopsis, as indicated:
[…] template<ranges::input_range R, class Compare = less<range-key-type<R>>, class Allocator = allocator<byte>> flat_map(from_range_t, R&&, Compare = Compare(), Allocator = Allocator()) -> flat_map<range-key-type<R>, range-mapped-type<R>, Compare, vector<range-key-type<R>, alloc-rebind<Allocator, range-key-type<R>>>, vector<range-mapped-type<R>, alloc-rebind<Allocator, range-mapped-type<R>>>>; template<ranges::input_range R, class Allocator> flat_map(from_range_t, R&&, Allocator) -> flat_map<range-key-type<R>, range-mapped-type<R>, less<range-key-type<R>>, vector<range-key-type<R>, alloc-rebind<Allocator, range-key-type<R>>>, vector<range-mapped-type<R>, alloc-rebind<Allocator, range-mapped-type<R>>>>; […]
Modify [flat.multimap.defn], class template flat_multimap synopsis, as indicated:
[…] template<ranges::input_range R, class Compare = less<range-key-type<R>>, class Allocator = allocator<byte>> flat_multimap(from_range_t, R&&, Compare = Compare(), Allocator = Allocator()) -> flat_multimap<range-key-type<R>, range-mapped-type<R>, Compare, vector<range-key-type<R>, alloc-rebind<Allocator, range-key-type<R>>>, vector<range-mapped-type<R>, alloc-rebind<Allocator, range-mapped-type<R>>>>; template<ranges::input_range R, class Allocator> flat_multimap(from_range_t, R&&, Allocator) -> flat_multimap<range-key-type<R>, range-mapped-type<R>, less<range-key-type<R>>, vector<range-key-type<R>, alloc-rebind<Allocator, range-key-type<R>>>, vector<range-mapped-type<R>, alloc-rebind<Allocator, range-mapped-type<R>>>>; […]
Modify [flat.set.defn], class template flat_set synopsis, as indicated:
[…] template<ranges::input_range R, class Compare = less<ranges::range_value_t<R>>, class Allocator = allocator<ranges::range_value_t<R>>> flat_set(from_range_t, R&&, Compare = Compare(), Allocator = Allocator()) -> flat_set<ranges::range_value_t<R>, Compare, vector<ranges::range_value_t<R>, alloc-rebind<Allocator, ranges::range_value_t<R>>>>; template<ranges::input_range R, class Allocator> flat_set(from_range_t, R&&, Allocator) -> flat_set<ranges::range_value_t<R>, less<ranges::range_value_t<R>>, vector<ranges::range_value_t<R>, alloc-rebind<Allocator, ranges::range_value_t<R>>>>; […]
Modify [flat.multiset.defn], class template flat_multiset synopsis, as indicated:
[…] template<ranges::input_range R, class Compare = less<ranges::range_value_t<R>>, class Allocator = allocator<ranges::range_value_t<R>>> flat_multiset(from_range_t, R&&, Compare = Compare(), Allocator = Allocator()) -> flat_multiset<ranges::range_value_t<R>, Compare, vector<ranges::range_value_t<R>, alloc-rebind<Allocator, ranges::range_value_t<R>>>>; template<ranges::input_range R, class Allocator> flat_multiset(from_range_t, R&&, Allocator) -> flat_multiset<ranges::range_value_t<R>, less<ranges::range_value_t<R>>, vector<ranges::range_value_t<R>, alloc-rebind<Allocator, ranges::range_value_t<R>>>>; […]
[ 2023-02-13 Approved at February 2023 meeting in Issaquah. Status changed: Immediate → WP. ]
[ Issaquah 2023-02-07; LWG ]
Edited proposed resolution to fix missing > in guides for maps. Move to Immediate for C++23
[ 2023-01-11; Jonathan Wakely provides improved wording ]
During LWG telecon Tim pointed out that because allocator<void> does not meet the Cpp17Allocator requirements, it might not "qualify as an allocator" and so would cause the deduction guides to not participate in overload resolution, as per [container.adaptors.general] p6 (6.4). Use allocator<byte> instead.
[ 2022-10-19; Jonathan provides improved wording ]
Previous resolution [SUPERSEDED]:
This wording is relative to N4917.
Modify [container.adaptors.general] as indicated:
-8- The following exposition-only alias templates may appear in deduction guides for container adaptors:
template<class Container> using cont-key-type = // exposition only remove_const_t<typename Container::value_type::first_type>; template<class Container> using cont-mapped-type = // exposition only typename Container::value_type::second_type; template<class Allocator, class T> using alloc-rebind = // exposition only typename allocator_traits<Allocator>::template rebind_alloc<T>;Modify [flat.map.defn], class template flat_map synopsis, as indicated:
[…] template<ranges::input_range R, class Compare = less<range-key-type<R>>, class Allocator = allocator<void>> flat_map(from_range_t, R&&, Compare = Compare(), Allocator = Allocator()) -> flat_map<range-key-type<R>, range-mapped-type<R>, Compare, vector<range-key-type<R>, alloc-rebind<Allocator, range-key-type<R>>, vector<range-mapped-type<R>, alloc-rebind<Allocator, range-mapped-type<R>>>; template<ranges::input_range R, class Allocator> flat_map(from_range_t, R&&, Allocator) -> flat_map<range-key-type<R>, range-mapped-type<R>, less<range-key-type<R>>, vector<range-key-type<R>, alloc-rebind<Allocator, range-key-type<R>>, vector<range-mapped-type<R>, alloc-rebind<Allocator, range-mapped-type<R>>>; […]Modify [flat.multimap.defn], class template flat_multimap synopsis, as indicated:
[…] template<ranges::input_range R, class Compare = less<range-key-type<R>>, class Allocator = allocator<void>> flat_multimap(from_range_t, R&&, Compare = Compare(), Allocator = Allocator()) -> flat_multimap<range-key-type<R>, range-mapped-type<R>, Compare, vector<range-key-type<R>, alloc-rebind<Allocator, range-key-type<R>>, vector<range-mapped-type<R>, alloc-rebind<Allocator, range-mapped-type<R>>>; template<ranges::input_range R, class Allocator> flat_multimap(from_range_t, R&&, Allocator) -> flat_multimap<range-key-type<R>, range-mapped-type<R>, less<range-key-type<R>>, vector<range-key-type<R>, alloc-rebind<Allocator, range-key-type<R>>, vector<range-mapped-type<R>, alloc-rebind<Allocator, range-mapped-type<R>>>; […]Modify [flat.set.defn], class template flat_set synopsis, as indicated:
[…] template<ranges::input_range R, class Compare = less<ranges::range_value_t<R>>, class Allocator = allocator<ranges::range_value_t<R>>> flat_set(from_range_t, R&&, Compare = Compare(), Allocator = Allocator()) -> flat_set<ranges::range_value_t<R>, Compare, vector<ranges::range_value_t<R>, alloc-rebind<Allocator, ranges::range_value_t<R>>>>; template<ranges::input_range R, class Allocator> flat_set(from_range_t, R&&, Allocator) -> flat_set<ranges::range_value_t<R>, less<ranges::range_value_t<R>>, vector<ranges::range_value_t<R>, alloc-rebind<Allocator, ranges::range_value_t<R>>>>; […]Modify [flat.multiset.defn], class template flat_multiset synopsis, as indicated:
[…] template<ranges::input_range R, class Compare = less<ranges::range_value_t<R>>, class Allocator = allocator<ranges::range_value_t<R>>> flat_multiset(from_range_t, R&&, Compare = Compare(), Allocator = Allocator()) -> flat_multiset<ranges::range_value_t<R>, Compare, vector<ranges::range_value_t<R>, alloc-rebind<Allocator, ranges::range_value_t<R>>>>; template<ranges::input_range R, class Allocator> flat_multiset(from_range_t, R&&, Allocator) -> flat_multiset<ranges::range_value_t<R>, less<ranges::range_value_t<R>>, vector<ranges::range_value_t<R>, alloc-rebind<Allocator, ranges::range_value_t<R>>>>; […]
[ 2022-09-28; LWG telecon ]
We should not just ignore the allocator, it should be rebound and used for the two container types.
Previous resolution [SUPERSEDED]:
This wording is relative to N4917.
Modify [flat.map.defn], class template flat_map synopsis, as indicated:
[…] template<ranges::input_range R, class Compare = less<range-key-type<R>>, class Allocator = allocator<void>> flat_map(from_range_t, R&&, Compare = Compare(), Allocator = Allocator()) -> flat_map<range-key-type<R>, range-mapped-type<R>, Compare>; […]Modify [flat.multimap.defn], class template flat_multimap synopsis, as indicated:
[…] template<ranges::input_range R, class Compare = less<range-key-type<R>>, class Allocator = allocator<void>> flat_multimap(from_range_t, R&&, Compare = Compare(), Allocator = Allocator()) -> flat_multimap<range-key-type<R>, range-mapped-type<R>, Compare>; […]
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-11-22 15:47:43 | admin | set | status: wp -> c++23 |
2023-02-13 11:31:32 | admin | set | messages: + msg13385 |
2023-02-13 11:31:32 | admin | set | status: immediate -> wp |
2023-02-09 02:30:45 | admin | set | messages: + msg13303 |
2023-02-09 02:30:45 | admin | set | status: open -> immediate |
2023-01-11 18:22:42 | admin | set | messages: + msg13197 |
2022-10-19 19:43:42 | admin | set | messages: + msg12871 |
2022-10-06 17:09:10 | admin | set | messages: + msg12841 |
2022-10-06 17:09:10 | admin | set | status: new -> open |
2022-09-25 11:23:04 | admin | set | messages: + msg12814 |
2022-09-25 00:00:00 | admin | create |