Page MenuHomePhabricator (Chris)

No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
diff --git a/util/pointer.h b/util/pointer.h
index 3bec30a8..078f8181 100644
--- a/util/pointer.h
+++ b/util/pointer.h
@@ -1,47 +1,48 @@
#ifndef _paintown_util_pointer_h
#define _paintown_util_pointer_h
namespace Util{
-/* Some helpful pointer classes, probably equivalent to stuff in boost */
+/* Some helpful pointer classes, probably equivalent to stuff in boost
+ */
/* Initializes its pointer to NULL and deletes the data in the destructor */
template <class Data>
class ClassPointer{
public:
ClassPointer():
data(NULL){
}
ClassPointer & operator=(Data * him){
data = him;
return *this;
}
Data & operator*() const {
return *data;
}
bool operator==(const void * what) const {
return data == what;
}
bool operator!=(const void * what) const {
return !(*this == what);
}
Data* operator->() const {
return data;
}
virtual ~ClassPointer(){
delete data;
}
private:
Data* data;
};
}
#endif

File Metadata

Mime Type
text/x-diff
Expires
Thu, Jun 11, 12:14 PM (3 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
68983
Default Alt Text
(1 KB)

Event Timeline