Add deduction guides to shared_ptr and weak_ptr. Fixes #73.

This commit is contained in:
Peter Dimov
2020-04-02 00:28:02 +03:00
parent 91cd83e5bf
commit 7b9a969215
6 changed files with 89 additions and 0 deletions
+7
View File
@@ -1175,6 +1175,13 @@ template<class D, class T> D const * basic_get_local_deleter( D const *, shared_
} // namespace detail
#if defined(__cpp_deduction_guides)
template<class T> shared_ptr( weak_ptr<T> ) -> shared_ptr<T>;
template<class T, class D> shared_ptr( std::unique_ptr<T, D> ) -> shared_ptr<T>;
#endif
} // namespace boost
#if defined( BOOST_SP_DISABLE_DEPRECATED )
+6
View File
@@ -264,6 +264,12 @@ template<class T> void swap(weak_ptr<T> & a, weak_ptr<T> & b) BOOST_SP_NOEXCEPT
a.swap(b);
}
#if defined(__cpp_deduction_guides)
template<class T> weak_ptr( shared_ptr<T> ) -> weak_ptr<T>;
#endif
} // namespace boost
#endif // #ifndef BOOST_SMART_PTR_WEAK_PTR_HPP_INCLUDED