Created on 2020-06-16.00:00:00 last changed 38 months ago
[ 2021-10-23 Resolved by the adoption of P2415R2 at the October 2021 plenary. Status changed: LEWG → Resolved. ]
[ 2021-02-16; Library Evolution Telecon Minutes ]
Poll: The shared_ptr part of the example mentioned in LWG3452 should be removed.
SF F N A SA 4 6 3 1 0
Attendance: 25
Outcome: Remove the shared_ptr part.Previous resolution [SUPERSEDED]:
This wording is relative to N4878.
Modify [range.view] as indicated:
template<class T> concept view = range<T> && movable<T> && default_initializable<T> && enable_view<T>;[…]-3- [Example 1: Examples of views are:
(3.1) — A range type that wraps a pair of iterators.
(3.2) — A range type that holds its elements by shared_ptr and shares ownership with all its copies.(3.3) — A range type that generates its elements on demand.
Most containers (Clause 22) are not views since destruction of the container destroys the elements, which cannot be done in constant time. — end example]
[ 2021-01-15; Telecon discussion ]
Set status to LEWG for guidance on the issue of what it means to model view.
[ 2020-06-26; Reflector prioritization ]
Set priority to 2 after reflector discussions.
The second bullet of [range.view] paragraph 3 says "Examples of views are:[…] A range type that holds its elements by shared_ptr and shares ownership with all its copies". That clearly does not have 𝒪(1) destruction in all cases. However, that does seem like a useful type of view, and is related to the discussions around the proposed std::generator.
What is the purpose of requiring 𝒪(1) destruction? Would it still be achieved by weakening it slightly to something like "If N copies and/or moves are made from a view that yields M values, destroying all of them takes time proportional to at worst 𝒪(N+M)"? This in particular prevents the 𝒪(N*M) case that I think the rules are trying to prevent, while still allowing some more interesting types of views.
If instead we actually really do want strict 𝒪(1) destruction, then the example needs to be fixed.
History | |||
---|---|---|---|
Date | User | Action | Args |
2021-10-23 11:04:22 | admin | set | status: lewg -> resolved |
2021-02-25 18:10:21 | admin | set | messages: + msg11698 |
2021-02-25 18:10:21 | admin | set | messages: + msg11697 |
2021-01-15 21:46:14 | admin | set | messages: + msg11654 |
2021-01-15 21:46:14 | admin | set | status: new -> lewg |
2020-06-26 11:48:00 | admin | set | messages: + msg11344 |
2020-06-16 00:00:00 | admin | create |