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
Implement P2325R3 Views Should Not Be Required To Be Default Constructible #2012
Implement P2325R3 Views Should Not Be Required To Be Default Constructible #2012
Changes from 6 commits
b767943
0a74f2b
8cd2340
85e054f
00eded0
208ff0b
5913610
64f032b
d4017db
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.
N4885 [insert.iter.ops]/1 says "Effects: Initializes
container
withaddressof(x)
anditer
withi
." Are we allowed tomove
here? Should this be restricted to the concepts implementation?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.
To me, the intent is that we're allowed to move instead of copy everywhere the standard depicts making a copy of an object that meets the
Cpp17CopyConstructible
/Cpp17CopyAssignable
requirements.Cpp17CopyConstructible
/Cpp17CopyAssignable
incorporateCpp17MoveConstructible
/Cpp17MoveAssignable
, so the move operations are required to be valid and produce "equivalent" results.That said, the difference is observable. Would you like me to submit an LWG issue to add blanket wording permitting an implementation to weaken copies to moves?
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.
Yes, I think an LWG issue would be great, thanks. It would need to be carefully phrased since implementations shouldn't be allowed to move from an object multiple times.
In any event, I'm ok with this code as-is.