[unique.ptr.general] Delete note listing unique_ptr use cases #7329
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.
As part of #7261.
[unique.ptr.general] p5 states:
This note should be deleted. It is not incorrect or misleading, but it is worded improperly for the standard and would require too much effort to fix. Specifically, the problems are:
The note provides very little value because everyone and their dog knows what
std::unique_ptr
is used for at this point.The standard does not define "dynamically allocated memory", so the note is informal.
The note is needlessly exhaustive.
std::unique_ptr
with custom deleters can be used to own all sorts of resources. At the very least, the note should state "include, but are not limited to".The note is not providing guidance to implementers and language lawyers, who are the actual target audience of the document. It seems to be listing possible uses for developers, so it reads like a tutorial note.
[unique.ptr.general] p1 already provides a more general introduction to
std::unique_ptr
with much less problematic wording.One could try to tackle all of these issues and turn this into a fantastic note perhaps, but I'm inclined to simply deleting it. It's not worth putting in the time, and it arguably reduces the quality of the standard.