Skip to content

Update template-specialization-cpp.md#3223

Merged
colin-home merged 2 commits into
MicrosoftDocs:masterfrom
jaigak:patch-2
Jul 9, 2021
Merged

Update template-specialization-cpp.md#3223
colin-home merged 2 commits into
MicrosoftDocs:masterfrom
jaigak:patch-2

Conversation

@jaigak

@jaigak jaigak commented Jun 27, 2021

Copy link
Copy Markdown
Contributor

Adds the delete statement for showcasing good practice.

@PRMerger13

Copy link
Copy Markdown
Contributor

@Jaiganeshkumaran : Thanks for your contribution! The author(s) have been notified to review your proposed change.

Switch to stack-based objects.
@PRMerger15

Copy link
Copy Markdown
Contributor

@corob-msft : Thanks for your contribution! The author(s) have been notified to review your proposed change.

@colin-home colin-home left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jaiganeshkumaran Thanks for the update and for bringing the leaky code to my attention. Rather than use heap objects, I edited your changes to use Modern stack-based style, so the objects are deleted when they go out of scope. I also updated the template parameters to match the current C++ string literal definitions. This code would have remained broken without your submission.

@colin-home colin-home merged commit f92e24f into MicrosoftDocs:master Jul 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants