-/* $Id$
-
-This file is part of libmspcore
-Copyright © 2006-2007, 2010-2011 Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
#ifndef MSP_CORE_REFPTR_H_
#define MSP_CORE_REFPTR_H_
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); }