Created on 2023-08-21.00:00:00 last changed 4 months ago
[ St. Louis 2024-06-24 Status changed: Open → NAD. ]
[ 2024-03-19; Tokyo: feedback from SG9 ]
SG9 believe that LWG3971 is a use-after-move and is working as intended. We further believe that matching the behavior of `concat_view` (which is the current behavior) is important. This is not a defect.
[ 2023-10-30; Reflector poll ]
Set priority to 3 after reflector poll. Send to SG9.
The issue that concat_view implicitly breaks equality-preserving by concatenating range of references with range of prvalues seems to be reflected in join_view as well.
When the reference of the inner range is string&& and the reference of the pattern range is prvalue string, dereferencing its iterator will move the elements of the inner range to the returned string, which makes the second dereference get an empty string (demo):
vector v1{"hello"s};
vector v2{"world"s};
vector v{v1 | views::as_rvalue, v2 | views::as_rvalue};
auto pattern = views::iota(0, 1) | views::transform([](int) { return ", "s; });
ranges::forward_range auto joined = v | views::join_with(pattern);
fmt::print("{}\n", joined); // ["hello", ", ", "world"]
fmt::print("{}\n", joined); // ["", ", ", ""]
Not sure if we should ban such less common case.
History | |||
---|---|---|---|
Date | User | Action | Args |
2024-06-24 16:13:01 | admin | set | messages: + msg14199 |
2024-06-24 16:13:01 | admin | set | status: open -> nad |
2024-03-19 07:22:44 | admin | set | messages: + msg14021 |
2023-10-30 16:39:42 | admin | set | messages: + msg13786 |
2023-10-30 16:39:42 | admin | set | status: new -> open |
2023-08-21 00:00:00 | admin | create |