+public:
+ /** Makes the RefPtr release its reference of the data without deleting it.
+ Note that if there are other RefPtrs left with the same data, it might
+ still get deleted automatically. */
+ T *release()
+ {
+ T *d = data;
+ data = 0;
+ decref();
+ count = 0;
+ return d;
+ }
+
+ /** Marks the data to not be deleted. This affects all RefPtrs with the
+ same data. */
+ void keep()
+ {
+ if(count)
+ *count |= KEEP;
+ }
+
+ T *get() const { return data; }
+ T &operator*() const { return *data; }