Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
🛠️ for
flat_set
#4050🛠️ for
flat_set
#4050Changes from 3 commits
536c00d
2cb6462
a251a3e
bf6b06a
cfde52b
d7e8768
4ca5b9b
b9be818
fa6c030
9f2e612
6bcbbe6
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
For example, without this constraint, when the comparer is transparent inputs like
non-const _Kty&
will go into this function. The case will be correctly handled by_Emplace
, but I think it will be better just fall toinsert(const _Kty&)
.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.
append_range
should be considered an optimization here.I notice that
insert_range(end,...)
(instead ofappend_range
) is unconditionally required for sequence containers. However, I think we don't have to give an extra check for that chance, as it is likely that a container that doesn't supportappend_range
will not supportinsert_range
either.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.
Also, I find these funtions lack
forward
(required by the standard):STL/stl/inc/stack
Lines 115 to 117 in 48eedd3
STL/stl/inc/queue
Lines 125 to 127 in 48eedd3
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.
Should we forward here? It seems that
std::forward
merely rejects non-borrowed-range rvalues, which defends dangling.But we are eagerly consuming ranges here, so it seems to me that we can just use the ranges as lvalues for containers. CC-ing @cor3ntin @ericniebler @CaseyCarter.