T *operator->() const { return data; }
operator bool() const { return data!=0; }
+ unsigned refcount() const { return (data ? *count : 0); }
+
template<typename U>
static RefPtr<T> cast_dynamic(const RefPtr<U> &p)
{ return RefPtr<T>(dynamic_cast<T *>(p.data), p.count); }