30-seconds-of-cpp icon indicating copy to clipboard operation
30-seconds-of-cpp copied to clipboard

Destroy

Open Arsivnet opened this issue 1 year ago • 0 comments

This PR adds the destroy() function as defined in https://en.cppreference.com/w/cpp/memory/destroy and https://cplusplus.com/reference/memory/allocator/destroy/ . There's also the destroy_at() function which destroys a single object, but i didn't see it listed on the todo.txt file. I can add a "run code" button if needed, but rextexter with gcc compiler selected didn't recognize the function, even though it works and compiles on my machine.

This is my first contribution, so looking forward to all feedback!

Fixes #31

Changes

I added a destroy.md file which includes a short description as well as a small piece of code as a demonstration of the function. I used the example in cplusplus.com but i changed it a bit to simplify it.

Checklist

  • [ X ] I have read CONTRIBUTING guidelines.
  • [ ] This is a typo fix.
  • [ X ] I am not updating any todo.txt files.

Arsivnet avatar Apr 29 '23 14:04 Arsivnet