Skip to content

Instantly share code, notes, and snippets.

@herzi
Created April 8, 2009 10:35
Show Gist options
  • Save herzi/91718 to your computer and use it in GitHub Desktop.
Save herzi/91718 to your computer and use it in GitHub Desktop.
#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