From: Thomas Geymayer Date: Wed, 6 Mar 2013 22:17:02 +0000 (+0100) Subject: add static_pointer_cast for SGSharedPtr X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e179bda57aee4c342df3168737b7dad0b6a3a8f7;p=simgear.git add static_pointer_cast for SGSharedPtr --- diff --git a/simgear/structure/SGSharedPtr.hxx b/simgear/structure/SGSharedPtr.hxx index 3de62e6c..479c1972 100644 --- a/simgear/structure/SGSharedPtr.hxx +++ b/simgear/structure/SGSharedPtr.hxx @@ -123,4 +123,13 @@ T* get_pointer(SGSharedPtr const & p) { return p.ptr(); } + +/** + * static_cast for SGSharedPtr + */ +template +SGSharedPtr static_pointer_cast(SGSharedPtr const & r) +{ + return SGSharedPtr( static_cast(r.get()) ); +} #endif