diff options
Diffstat (limited to 'include/comphelper/make_shared_from_uno.hxx')
-rw-r--r-- | include/comphelper/make_shared_from_uno.hxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/comphelper/make_shared_from_uno.hxx b/include/comphelper/make_shared_from_uno.hxx index 03bc03c6036c..17496eeb4aa4 100644 --- a/include/comphelper/make_shared_from_uno.hxx +++ b/include/comphelper/make_shared_from_uno.hxx @@ -19,8 +19,8 @@ #ifndef INCLUDED_COMPHELPER_MAKE_SHARED_FROM_UNO_HXX #define INCLUDED_COMPHELPER_MAKE_SHARED_FROM_UNO_HXX -#include <boost/shared_ptr.hpp> #include <functional> +#include <memory> namespace comphelper { @@ -32,12 +32,12 @@ template <typename T> struct ReleaseFunc : ::std::unary_function<T *, void> { }; } // namespace detail -/** Makes a boost::shared_ptr from a ref-counted UNO object pointer. +/** Makes a std::shared_ptr from a ref-counted UNO object pointer. This makes sense if the object is used via UNO (implementing some X interface) and also internally using its implementation class, e.g. <pre> - boost::shared_ptr<MyUnoImpl> const ptr( + std::shared_ptr<MyUnoImpl> const ptr( comphelper::make_shared_from_UNO( new MyUnoImpl ) ); ... xUno->callingUno( uno::Reference<XSomeInterface>( ptr.get() ) ); @@ -47,7 +47,7 @@ template <typename T> struct ReleaseFunc : ::std::unary_function<T *, void> { </pre> @attention The shared_ptr operates on a separate reference counter, so - weak pointers (boost::weak_ptr) are invalidated when the last + weak pointers (std::weak_ptr) are invalidated when the last shared_ptr is destroyed, although the UNO object may still be alive. @@ -55,10 +55,10 @@ template <typename T> struct ReleaseFunc : ::std::unary_function<T *, void> { @return shared_ptr to object */ template <typename T> -inline ::boost::shared_ptr<T> make_shared_from_UNO( T * p ) +inline std::shared_ptr<T> make_shared_from_UNO( T * p ) { p->acquire(); - return ::boost::shared_ptr<T>( p, detail::ReleaseFunc<T>() ); + return std::shared_ptr<T>( p, detail::ReleaseFunc<T>() ); } } // namespace comphelper |