-
Notifications
You must be signed in to change notification settings - Fork 740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
P0429R9 A Standard flat_map #5626
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is [assoc.format] coming from a different paper? There's an instruction in the paper to change it.
\pnum | ||
Any sequence container\iref{sequence.reqmts} \tcode{C} | ||
supporting \oldconcept{RandomAccessIterator} can be used |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This must be referring to C
's associated iterator type(s). How can this be improved? For reference:
Any sequence container with random access iterator and supporting operations front(), push_back() and pop_back() can be used to instantiate priority_queue.
-- https://eel.is/c++draft/priority.queue#priqueue.overview-1.sentence-1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jwakely, @CaseyCarter: Any thoughts? I don't think this is broken enough to warrant an immediate fix here, but I'm happy to entertain editorial improvement requests.
Yes, there's a mess of interactions here. P2286 adds [assoc.format], the |
See the improved instructions in p2585r1, which is the version being polled at plenary. |
-> flat_map<@\exposid{iter-key-type}@<InputIterator>, @\exposid{iter-mapped-type}@<InputIterator>, Compare>; | ||
|
||
template<ranges::input_range R, class Compare = less<@\exposid{range-key-type}@<R>>, | ||
class Allocator> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this right? What does it mean that the previous template parameter Compare
is defaulted, but Allocator
isn't, even though both corresponding function parameters are defaulted? Seems like you can't get this to work without defaulting this Allocator
: https://godbolt.org/z/fYesrsbMz.
class Allocator> | |
class Allocator = allocator<ranges::range_value_t<R>>> |
class Allocator> | |
class Allocator = allocator<@\exposid{range-mapped-type}@<R>>> |
I think both suggestions fulfill the corresponding Constraints element.
class Allocator> | |
class Allocator = allocator<void>> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think allocator<void>
would be just as good. It's going to be rebound anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jwakely: are you (= LWG) happy to add a default argument allocator<void>
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that's editorial. Needs a library issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #5800.
How about replacing them with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's some refactoring for simpler wording.
b515acd
to
9d40840
Compare
That would be correct, but I don't think it would improve the specification, as you have to follow an indirection to see what the constraint is actually telling you. Maybe that's OK, as the standard is not a tutorial. |
cab33fa
to
a1bdd36
Compare
a1bdd36
to
a418add
Compare
517a65a
to
686dc49
Compare
- Replaced "may" with "can" in notes. - Replace && in constraints with prose "and" to avoid overfull \hbox
The earlier wording of "containers that the user defines" was not retained for new additions to the Standard, and it is needlessly informal. The term "program-defined" was only added recently, whereas the original wording has essentially existed since the beginnig.
686dc49
to
3096293
Compare
Fixes #5593
Fixes cplusplus/papers#101