Skip to content

Instantly share code, notes, and snippets.

@kalman5
Created May 21, 2014 20:41
Show Gist options
  • Select an option

  • Save kalman5/4f9bab4b1e9f127446ce to your computer and use it in GitHub Desktop.

Select an option

Save kalman5/4f9bab4b1e9f127446ce to your computer and use it in GitHub Desktop.
template <class T>
class AutoPtr {
public:
AutoPtr(T* aPointer)
: thePointer(aPointer)
{}
~AutoPtr() {
delete thePointer;
}
void reset() {
delete thePointer;
thePointer = nullptr;
}
private:
T* thePointer;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment