Last active
May 16, 2019 17:03
-
-
Save native-m/566d9a32c87750a604380e3056d777c9 to your computer and use it in GitHub Desktop.
use this if you are lazy to delete multiple pointers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ifndef LAZY_DELETE_H | |
| #define LAZY_DELETE_H | |
| template <class Delete> | |
| void deleteAll(Delete del) | |
| { | |
| delete del; | |
| } | |
| template <class Delete, class... Deletes> | |
| void deleteAll(Delete del, Deletes... dels) | |
| { | |
| delete del; | |
| deleteAll(dels...); | |
| } | |
| #endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment