Created on 2022-10-25.00:00:00 last changed 24 months ago
Proposed resolution:
This wording is relative to N4917.
Modify [re.results.general], class template match_results synopsis, as indicated:
namespace std { template<class BidirectionalIterator, class Allocator = allocator<sub_match<BidirectionalIterator>>> class match_results { […] void swap(match_results& that); }; template<class Allocator> match_results(Allocator) -> match_results<typename Allocator::value_type::iterator, Allocator>; }
[ 2022-11-30 LWG telecon. Status changed: Tentatively NAD → NAD. ]
[ 2022-11-01; reflector poll ]
Status changed to Tentatively NAD. The issue is wrong: other containers do not support deduction from an allocator type.
std::match_results meets some of the requirements for an allocator-aware container, which means that its allocator_type must have the same value_type as the container. This means that class template argument deduction should work for:
std::match_results mr(alloc);
The allocator's value_type will be the sub_match<Iter> type stored in the match_results object, and so the first template argument for the match_results type will be value_type::iterator.
P0433R2 added a deduction guide for std::basic_regex, but I see no rationale for not adding one for std::match_results. This seems like a defect, because all other allocator-aware containers support deduction from an allocator argument.History | |||
---|---|---|---|
Date | User | Action | Args |
2022-11-30 17:59:24 | admin | set | messages: + msg13143 |
2022-11-01 17:38:24 | admin | set | messages: + msg12910 |
2022-11-01 17:38:24 | admin | set | status: new -> nad |
2022-10-28 12:12:57 | admin | set | messages: + msg12890 |
2022-10-25 00:00:00 | admin | create |