[Boost-bugs] [Boost C++ Libraries] #2951: Unwanted implicit conversion from std::auto_ptr to boost:; shared_ptr

Subject: [Boost-bugs] [Boost C++ Libraries] #2951: Unwanted implicit conversion from std::auto_ptr to boost:; shared_ptr
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-04-16 22:22:21


#2951: Unwanted implicit conversion from std::auto_ptr to boost:;shared_ptr
------------------------------------------------+---------------------------
 Reporter: William Tanenbaum <wmtan_at_[hidden]> | Owner: pdimov
     Type: Bugs | Status: new
Milestone: Boost 1.39.0 | Component: smart_ptr
  Version: Boost 1.38.0 | Severity: Regression
 Keywords: implicit conversion shared pointer |
------------------------------------------------+---------------------------
 In boost 1.38, the explicit keyword was dropped from this constructor
 template in shared_ptr.hpp:

 template<class Ap>
 shared_ptr( AP r, typename boost::detail::sp_enable_if_auto_ptr<Ap,
 int>::type = 0 ): px( r.get() ), pn()
 {
    typename Ap::element_type * tmp = r.get();
    pn = boost::detail::shared_count( r );
    boost::detail::sp_enable_shared_from_this( pn, tmp, tmp );
 }

 The explicit keyword was there in boost 1.34. This causes implicit
 conversions from auto_ptr to shared_ptr, which is undesirable.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/2951>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:00 UTC