Constrain conversions to shared_ptr/weak_ptr

This commit is contained in:
Peter Dimov
2017-06-13 20:57:12 +03:00
parent 47ee1e09e9
commit 27898b0823

View File

@ -474,7 +474,11 @@ public:
// conversions to shared_ptr, weak_ptr // conversions to shared_ptr, weak_ptr
#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && !defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS)
template<class Y, class E = typename boost::detail::sp_enable_if_convertible<T,Y>::type> operator shared_ptr<Y>() const BOOST_SP_NOEXCEPT
#else
template<class Y> operator shared_ptr<Y>() const BOOST_SP_NOEXCEPT template<class Y> operator shared_ptr<Y>() const BOOST_SP_NOEXCEPT
#endif
{ {
boost::detail::sp_assert_convertible<T, Y>(); boost::detail::sp_assert_convertible<T, Y>();
@ -488,7 +492,11 @@ public:
} }
} }
#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && !defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS)
template<class Y, class E = typename boost::detail::sp_enable_if_convertible<T,Y>::type> operator weak_ptr<Y>() const BOOST_SP_NOEXCEPT
#else
template<class Y> operator weak_ptr<Y>() const BOOST_SP_NOEXCEPT template<class Y> operator weak_ptr<Y>() const BOOST_SP_NOEXCEPT
#endif
{ {
boost::detail::sp_assert_convertible<T, Y>(); boost::detail::sp_assert_convertible<T, Y>();