X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fcore%2Frefptr.h;h=0328340eb242242b29fa614d0b7b815eddcc8f3b;hp=d245b34a7e90bab8fb14f5e26cc691a1385f761c;hb=cc541830f00cc3238edb82ff2e14e8b9060645b6;hpb=0f32d120e05ebc207dcd2ea733714f29795cb26b diff --git a/source/core/refptr.h b/source/core/refptr.h index d245b34..0328340 100644 --- a/source/core/refptr.h +++ b/source/core/refptr.h @@ -88,6 +88,8 @@ public: T *operator->() const { return data; } operator bool() const { return data!=0; } + unsigned refcount() const { return (data ? *count : 0); } + template static RefPtr cast_dynamic(const RefPtr &p) { return RefPtr(dynamic_cast(p.data), p.count); }