Created on 2016-01-24.00:00:00 last changed 90 months ago
Proposed resolution:
This wording is relative to N4567.
Change [re.results] p2 as indicated:
-2- The class template match_results
shall satisfysatisfies the requirements of an allocator-aware container and of a sequence container,as specified in(23.2.3), except that only operations defined for const-qualified sequence containers are supported and the semantics of comparison functions are different from those required for a container.
[Drafting note: (Post-Issaquah) Due to the outdated N4567 wording the project editor accepted the following merge suggestion into N4606 wording: — end drafting note]
This wording is relative to N4606.
Change [re.results] p2 as indicated:
-2- The class template match_results satisfies the requirements of an allocator-aware container and of a sequence container,
as specified in([container.requirements.general]and, [sequence.reqmts])respectively, except that only operations defined for const-qualified sequence containers are supported and the semantics of comparison functions are different from those required for a container.
[ 2016-08 - Chicago ]
Thurs AM: Moved to Tentatively Ready
Previous resolution [SUPERSEDED]:
This wording is relative to N4567.
Change [re.results] p2 as indicated:
-2- The class template match_results shall satisfy the requirements of an allocator-aware container and of a sequence container, as specified in 23.2.3, except that only operations defined for const-qualified sequence containers are supported and that the semantics of comparison functions are different from those required for a container.
[ 2016-02, Issues Telecon ]
Marshall: The submitter is absolutely right, but the proposed resolution is insufficient. We should avoid "shall", for once.2016-05: Marshall cleans up the wording around the change
N4567 [re.results] p2 mentions
The class template match_results shall satisfy the requirements of an allocator-aware container and of a sequence container, as specifed in 23.2.3, except that only operations defined for const-qualified sequence containers are supported.
However, this is impossible because match_results has a operator== whose semantics differs from the one required in Table 95 — "Container requirements".
Table 95 requires that a == b is an equivalence relation and means equal(a.begin(), a.end(), b.begin(), b.end()). But for match_results, a == b and equal(a.begin(), a.end(), b.begin(), b.end()) can give different results. For example:#include <iostream> #include <regex> #include <string> #include <algorithm> int main() { std::regex re("a*"); std::string target("baaab"); std::smatch a; std::regex_search(target, a, re); std::string target2("raaau"); std::smatch b; std::regex_search(target2, b, re); std::cout << std::boolalpha; std::cout << (a == b) << '\n'; // false std::cout << std::equal(a.begin(), a.end(), b.begin(), b.end()) << '\n'; // true }
History | |||
---|---|---|---|
Date | User | Action | Args |
2017-07-30 20:15:43 | admin | set | status: wp -> c++17 |
2016-11-14 03:59:28 | admin | set | status: pending -> wp |
2016-11-14 03:55:22 | admin | set | status: ready -> pending |
2016-08-05 03:33:05 | admin | set | messages: + msg8415 |
2016-08-05 03:33:05 | admin | set | status: new -> ready |
2016-02-07 20:24:45 | admin | set | messages: + msg7976 |
2016-01-30 14:21:39 | admin | set | messages: + msg7945 |
2016-01-24 00:00:00 | admin | create |