Small nits for destructors cpp#4826
Conversation
|
@Rageking8 : Thanks for your contribution! The author(s) have been notified to review your proposed change. |
|
Learn Build status updates of commit 7064942: ✅ Validation status: passed
For more details, please refer to the build report. For any questions, please:
|
#label:"aq-pr-triaged" |
| - A local (automatic) object with block scope goes out of scope. | ||
|
|
||
| - An object allocated using the **`new`** operator is explicitly deallocated using **`delete`**. | ||
| - An object allocated using the **`new`** or **`new[]`** operator is explicitly deallocated using **`delete`** or **`delete[]`**. |
There was a problem hiding this comment.
I see the parallelism here, but let's make it more explicit since you shouldn't use delete to deallocate memory allocated with new[]. Something like "An object allocated using new should be deallocated with delete. An object allocated using new[] should be deallocated with delete[]
There was a problem hiding this comment.
I can't think of a way to make it flow well if we keep to 1 bullet point, hence, I split it into 2. I kept the phrasing of the first part of each bullet point, since it is in the Destructors are called when one of the following events occurs: part.
| } | ||
|
|
||
| Output: A3 dtor | ||
| /* Output: A3 dtor |
There was a problem hiding this comment.
The thing to do here is break this out of the code block, and add a section immediately after that starts:
Three ticks: ```output
A3 dtor
...
I've seen the pattern you are trying here in some of our docs. That's an old pattern and I remove it when I come across it, so don't want to introduce it afresh in new docs.
There was a problem hiding this comment.
"```Output" with a capital "O" has over 1k matches, but "```output" with a lowercase "o" only have 60 something hits. Is any one of the above preferred, or it does not matter?
There was a problem hiding this comment.
It doesn't matter because we are relying on the tag for the code block type to do the rendering for us.
|
Learn Build status updates of commit b988817: ✅ Validation status: passed
For more details, please refer to the build report. For any questions, please:
|
A little edit pass
|
Learn Build status updates of commit db1c552: ✅ Validation status: passed
For more details, please refer to the build report. For any questions, please:
|
TylerMSFT
left a comment
There was a problem hiding this comment.
@Rageking8, hey, thank you for all the contributions you have made to the C++ docs! I really appreciate the help and hope you have a great holiday season.
|
#sign-off |
Make mention of
new/new[]anddelete/delete[]operators more precise. The empty braces are added to the class list example to prevent invalid syntax highlighting issues. Some other miscellaneous nits added.