-
Notifications
You must be signed in to change notification settings - Fork 774
[expr.new], [class.free] Remove "free store" from the index #7041
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
[expr.new], [class.free] Remove "free store" from the index #7041
Conversation
source/intro.tex
Outdated
@@ -16,8 +16,8 @@ | |||
\Cpp{} provides many facilities | |||
beyond those provided by C, including additional data types, | |||
classes, templates, exceptions, namespaces, operator | |||
overloading, function name overloading, references, free store | |||
management operators, and additional library facilities.% | |||
overloading, function name overloading, references, allocation and |
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 doesn't preserve the meaning of the original wording, which describes features that C++ has beyond C. C also has allocation and deallocation functions (malloc
and free
).
If we said replaceable or class-specific allocation functions, that would be a beyond-C feature.
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.
Or just keep the word operators, since that's what it originally said, and C doesn't have those. The operators construct and destroy objects instead of just allocating. C doesn't have that (just calloc
which doesn't work for non-trivial types).
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 doesn't preserve the meaning of the original wording, which describes features that C++ has beyond C. C also has allocation and deallocation functions (
malloc
andfree
).
In the C++ standard wording, allocation and deallocation functions are operator new
/operator new[]
and operator delete
/operator delete[]
but not other functions. But such meaning seems confusing in more general contexts.
I'm now using "allocation and deallocation operator functions", as these functions are also operator functions ([over.oper.general]/1) and operator functions are clearly beyond C.
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.
Or just keep the word operators, since that's what it originally said, and C doesn't have those. The operators construct and destroy objects instead of just allocating. C doesn't have that (just
calloc
which doesn't work for non-trivial types).
Hmm, however, as you said here, the new
and delete
operators are more than "free store management" which seemingly just refers to allocating and deallocating. The original meaning is unclear to me.
An early draft seemingly indicated that free storage management operators are allocation and deallocation functions (in Clause 12).
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, @jensmaurer Thoughts on "allocation operator functions"?
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.
We never call those "allocation operator functions". They're just "allocation functions". Also, the original wording talks about "free store management operators", which is something like "new T" (allocates and constructs), whereas allocation functions just allocate raw bytes --- and C has those, too, sort-of.
I think "free store management operators" is good enough for this intro paragraph.
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.
Thanks, Jens, agreed!
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.
@tkoeppe , my comment was applying to a single use of "free store"; there are other replaced uses that might be fine (I haven't looked). Closing this pull request based on a single bad change feels over-the-top. |
The rest is just indexing I think, but sure. |
Ah, right, the rest is just indexing indeed. And we do want to have "foreign" phrases in the index in case people go looking for them, so that we can direct them to "our" world. Apologies. |
As we have already indexed class-specific allocation and deallocation functions, it is perhaps fine to remove "free store".