Created
April 8, 2009 10:35
-
-
Save herzi/91718 to your computer and use it in GitHub Desktop.
This file contains 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 SMARTPOINTER_H | |
#define SMARTPOINTER_H | |
namespace Pptout { | |
template<class PointerType, | |
void freeFunc(PointerType) | |
> | |
class SmartPointer | |
{ | |
private: | |
PointerType c_pointer; | |
public: | |
SmartPointer(PointerType cpointer) : | |
c_pointer(cpointer) | |
{} | |
~SmartPointer() | |
{ | |
freeFunc(c_pointer); | |
c_pointer = 0; | |
} | |
}; | |
}; | |
#endif /* !SMARTPOINTER_H */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment