Skip to content

Instantly share code, notes, and snippets.

@native-m
Last active May 16, 2019 17:03
Show Gist options
  • Select an option

  • Save native-m/566d9a32c87750a604380e3056d777c9 to your computer and use it in GitHub Desktop.

Select an option

Save native-m/566d9a32c87750a604380e3056d777c9 to your computer and use it in GitHub Desktop.
use this if you are lazy to delete multiple pointers
#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