From 27898b0823949b05c4c8c7d3ad5ab68aa8ee2328 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 13 Jun 2017 20:57:12 +0300 Subject: [PATCH] Constrain conversions to shared_ptr/weak_ptr --- include/boost/smart_ptr/local_shared_ptr.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/boost/smart_ptr/local_shared_ptr.hpp b/include/boost/smart_ptr/local_shared_ptr.hpp index 71f31a4..1a42546 100644 --- a/include/boost/smart_ptr/local_shared_ptr.hpp +++ b/include/boost/smart_ptr/local_shared_ptr.hpp @@ -474,7 +474,11 @@ public: // conversions to shared_ptr, weak_ptr +#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && !defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS) + template::type> operator shared_ptr() const BOOST_SP_NOEXCEPT +#else template operator shared_ptr() const BOOST_SP_NOEXCEPT +#endif { boost::detail::sp_assert_convertible(); @@ -488,7 +492,11 @@ public: } } +#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && !defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS) + template::type> operator weak_ptr() const BOOST_SP_NOEXCEPT +#else template operator weak_ptr() const BOOST_SP_NOEXCEPT +#endif { boost::detail::sp_assert_convertible();