-
Notifications
You must be signed in to change notification settings - Fork 9
P1684: Specify requirements on Container #17
Comments
Right now the only distinguishing thing there is for the constructors which take arguments you can't directly allocate the underlying container from (say a mapping or multiple sizes). All the other constructors (from initializer list, from container, from container via move, ranges-to etc.) would work with any container which supports the corresponding constructors. Unfortunately, there is nothing in containers which tells me how to generically know whether a containers default constructor constructs a thing with size while not having a constructor which takes a size. Hence we can't generically tell whether the Note |
So I don't think there is anything more specific I want to require than what we require now. In the very worst case for a container which has just a move or copy constructor plus some constructor which takes a bazillion arguments, mdarray would only have the constructors which copy or move from the container, plust the arguments to construct the mapping. |
Minor design issue for container requirements: "contiguous container" just says that the iterators are contiguous iterators, not that the container has a |
I tried to fix that with P1768 Contiguous Containers Should Contain .data(). Do we need it, or can we state the requirement in terms of |
Thank you @nliber ! : - ) I don't think we need @crtrott -- I think that's fine. The current wording already says that Container must be a contiguous container, and that gives us |
This comes from 1684R2 LEWG review on 2022/04/19.
We have no experience (do we?) with Container types other than
vector
andarray
. Should we restrict to those two types, or do the hard work of wording for other types likestatic_vector
(fixed capacity that bounds the size)?For example, the current wording only distinguishes between
array
and every other type. However, some other types, likestatic_vector
, may default-construct nonempty, just likearray
. The question relates to whether the container can be constructed with a run-time size, vs. whether the container is "constructed nonempty" without a size.The text was updated successfully, but these errors were encountered: