- NodePtr(T *n = 0): node(n) { }
- NodePtr(const NodePtr &p): node(clone(p.node)) { }
- NodePtr &operator=(const NodePtr &p) { delete node; node = clone(p.node); return *this; }
-#if __cplusplus>=201103L
- NodePtr(NodePtr &&p): node(p.node) { p.node = 0; }
- NodePtr &operator=(NodePtr &&p) { delete node; node = p.node; p.node = 0; return *this; }
-#endif
- ~NodePtr() { delete node; }
+ NodePtr() { }
+ NodePtr(T *p): RefPtr<T>(p) { }
+ NodePtr(const NodePtr &p): RefPtr<T>(p ? p->clone() : 0) { }
+ NodePtr &operator=(const NodePtr &p) { RefPtr<T>::operator=(p); return *this; }