add static_pointer_cast for SGSharedPtr

This commit is contained in:
Thomas Geymayer 2013-03-06 23:17:02 +01:00
parent 8e0c15e32e
commit e179bda57a

View File

@ -123,4 +123,13 @@ T* get_pointer(SGSharedPtr<T> const & p)
{
return p.ptr();
}
/**
* static_cast for SGSharedPtr
*/
template<class T, class U>
SGSharedPtr<T> static_pointer_cast(SGSharedPtr<U> const & r)
{
return SGSharedPtr<T>( static_cast<T*>(r.get()) );
}
#endif