Boost C++ Libraries: Ticket #4185: VC10 std::shared_ptr not supported? https://svn.boost.org/trac10/ticket/4185 <p> VC10 std::shared_ptr doesn't appear to be supported by boost::bind and requires a manual get_pointer overload. </p> <p> 1&gt;c:\vc\include\boost/bind/mem_fn_template.hpp(156): error C2784: 'T *boost::get_pointer(const std::auto_ptr&lt;_Ty&gt; &amp;)' : could not deduce template argument for 'const std::auto_ptr&lt;_Ty&gt; &amp;' from 'std::tr1::shared_ptr&lt;_Ty&gt;' </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4185 Trac 1.4.3 viboes Mon, 22 Oct 2012 22:08:34 GMT milestone changed; cc set https://svn.boost.org/trac10/ticket/4185#comment:1 https://svn.boost.org/trac10/ticket/4185#comment:1 <ul> <li><strong>cc</strong> <span class="trac-author">viboes</span> added </li> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.43.0</span> → <span class="trac-field-new">To Be Determined</span> </li> </ul> <p> Could you post an example showing the error? </p> Ticket Olaf van der Spek <olafvdspek@…> Mon, 22 Oct 2012 22:12:19 GMT <link>https://svn.boost.org/trac10/ticket/4185#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4185#comment:2</guid> <description> <pre class="wiki">1&gt;c:\vc\include\boost\bind\mem_fn_template.hpp(156): error C2784: 'T *boost::get_pointer(const boost::scoped_ptr&lt;T&gt; &amp;)' : could not deduce template argument for 'const boost::scoped_ptr&lt;T&gt; &amp;' from 'std::shared_ptr&lt;_Ty&gt;' 1&gt; with 1&gt; [ 1&gt; _Ty=connection 1&gt; ] 1&gt; c:\vc\include\boost\smart_ptr\scoped_ptr.hpp(124) : see declaration of 'boost::get_pointer' 1&gt; c:\vc\include\boost\bind\mem_fn_template.hpp(171) : see reference to function template instantiation 'R boost::_mfi::mf1&lt;R,T,A1&gt;::call&lt;U,const boost::system::error_code&gt;(U &amp;,const void *,B1 &amp;) const' being compiled 1&gt; with 1&gt; [ 1&gt; R=void, 1&gt; T=connection, 1&gt; A1=const boost::system::error_code &amp;, 1&gt; U=std::shared_ptr&lt;connection&gt;, 1&gt; B1=const boost::system::error_code 1&gt; ] 1&gt; c:\vc\include\boost\bind\mem_fn_template.hpp(171) : see reference to function template instantiation 'R boost::_mfi::mf1&lt;R,T,A1&gt;::call&lt;U,const boost::system::error_code&gt;(U &amp;,const void *,B1 &amp;) const' being compiled 1&gt; with 1&gt; [ 1&gt; R=void, 1&gt; T=connection, 1&gt; A1=const boost::system::error_code &amp;, 1&gt; U=std::shared_ptr&lt;connection&gt;, 1&gt; B1=const boost::system::error_code 1&gt; ] 1&gt; c:\vc\include\boost\bind\bind.hpp(313) : see reference to function template instantiation 'R boost::_mfi::mf1&lt;R,T,A1&gt;::operator ()&lt;std::shared_ptr&lt;_Ty&gt;&gt;(U &amp;,A1) const' being compiled 1&gt; with 1&gt; [ 1&gt; R=void, 1&gt; T=connection, 1&gt; A1=const boost::system::error_code &amp;, 1&gt; _Ty=connection, 1&gt; U=std::shared_ptr&lt;connection&gt; 1&gt; ] 1&gt; c:\vc\include\boost\bind\bind.hpp(313) : see reference to function template instantiation 'R boost::_mfi::mf1&lt;R,T,A1&gt;::operator ()&lt;std::shared_ptr&lt;_Ty&gt;&gt;(U &amp;,A1) const' being compiled 1&gt; with 1&gt; [ 1&gt; R=void, 1&gt; T=connection, 1&gt; A1=const boost::system::error_code &amp;, 1&gt; _Ty=connection, 1&gt; U=std::shared_ptr&lt;connection&gt; 1&gt; ] 1&gt; c:\vc\include\boost\bind\bind_template.hpp(102) : see reference to function template instantiation 'void boost::_bi::list2&lt;A1,A2&gt;::operator ()&lt;F,boost::_bi::list2&lt;const boost::system::error_code &amp;,const unsigned int &amp;&gt;&gt;(boost::_bi::type&lt;T&gt;,F &amp;,A &amp;,int)' being compiled 1&gt; with 1&gt; [ 1&gt; A1=boost::_bi::value&lt;std::shared_ptr&lt;connection&gt;&gt;, 1&gt; A2=boost::arg&lt;1&gt;, 1&gt; F=boost::_mfi::mf1&lt;void,connection,const boost::system::error_code &amp;&gt;, 1&gt; T=void, 1&gt; A=boost::_bi::list2&lt;const boost::system::error_code &amp;,const size_t &amp;&gt; 1&gt; ] 1&gt; c:\vc\include\boost\bind\bind_template.hpp(102) : see reference to function template instantiation 'void boost::_bi::list2&lt;A1,A2&gt;::operator ()&lt;F,boost::_bi::list2&lt;const boost::system::error_code &amp;,const unsigned int &amp;&gt;&gt;(boost::_bi::type&lt;T&gt;,F &amp;,A &amp;,int)' being compiled 1&gt; with 1&gt; [ 1&gt; A1=boost::_bi::value&lt;std::shared_ptr&lt;connection&gt;&gt;, 1&gt; A2=boost::arg&lt;1&gt;, 1&gt; F=boost::_mfi::mf1&lt;void,connection,const boost::system::error_code &amp;&gt;, 1&gt; T=void, 1&gt; A=boost::_bi::list2&lt;const boost::system::error_code &amp;,const size_t &amp;&gt; 1&gt; ] 1&gt; c:\vc\include\boost\asio\detail\handler_type_requirements.hpp(79) : see reference to function template instantiation 'void boost::_bi::bind_t&lt;R,F,L&gt;::operator ()&lt;const Arg1,const Arg2&gt;(const A1 &amp;,const A2 &amp;)' being compiled 1&gt; with 1&gt; [ 1&gt; R=void, 1&gt; F=boost::_mfi::mf1&lt;void,connection,const boost::system::error_code &amp;&gt;, 1&gt; L=boost::_bi::list2&lt;boost::_bi::value&lt;std::shared_ptr&lt;connection&gt;&gt;,boost::arg&lt;1&gt;&gt;, 1&gt; Arg1=const boost::system::error_code, 1&gt; Arg2=const size_t, 1&gt; A1=const boost::system::error_code, 1&gt; A2=const size_t 1&gt; ] 1&gt; c:\vc\include\boost\asio\impl\read.hpp(274) : see reference to function template instantiation 'void boost::_bi::bind_t&lt;R,F,L&gt;::operator ()&lt;const Arg1,const Arg2&gt;(const A1 &amp;,const A2 &amp;)' being compiled 1&gt; with 1&gt; [ 1&gt; R=void, 1&gt; F=boost::_mfi::mf1&lt;void,connection,const boost::system::error_code &amp;&gt;, 1&gt; L=boost::_bi::list2&lt;boost::_bi::value&lt;std::shared_ptr&lt;connection&gt;&gt;,boost::arg&lt;1&gt;&gt;, 1&gt; Arg1=const boost::system::error_code, 1&gt; Arg2=const size_t, 1&gt; A1=const boost::system::error_code, 1&gt; A2=const size_t 1&gt; ] 1&gt; c:\vc\xbt\turbo\connection.cpp(64) : see reference to function template instantiation 'void boost::asio::async_read&lt;boost::asio::ip::tcp::socket,boost::asio::mutable_buffers_1,boost::_bi::bind_t&lt;R,F,L&gt;&gt;(AsyncReadStream &amp;,const MutableBufferSequence &amp;,const ReadHandler &amp;)' being compiled 1&gt; with 1&gt; [ 1&gt; R=void, 1&gt; F=boost::_mfi::mf1&lt;void,connection,const boost::system::error_code &amp;&gt;, 1&gt; L=boost::_bi::list2&lt;boost::_bi::value&lt;std::shared_ptr&lt;connection&gt;&gt;,boost::arg&lt;1&gt;&gt;, 1&gt; AsyncReadStream=boost::asio::ip::tcp::socket, 1&gt; MutableBufferSequence=boost::asio::mutable_buffers_1, 1&gt; ReadHandler=boost::_bi::bind_t&lt;void,boost::_mfi::mf1&lt;void,connection,const boost::system::error_code &amp;&gt;,boost::_bi::list2&lt;boost::_bi::value&lt;std::shared_ptr&lt;connection&gt;&gt;,boost::arg&lt;1&gt;&gt;&gt; 1&gt; ] 1&gt; c:\vc\include\boost\smart_ptr\scoped_ptr.hpp(124) : see declaration of 'boost::get_pointer' 1&gt;c:\vc\include\boost\bind\mem_fn_template.hpp(156): error C2784: 'T *boost::get_pointer(const boost::intrusive_ptr&lt;T&gt; &amp;)' : could not deduce template argument for 'const boost::intrusive_ptr&lt;T&gt; &amp;' from 'std::shared_ptr&lt;_Ty&gt;' 1&gt; with 1&gt; [ 1&gt; _Ty=connection 1&gt; ] 1&gt; c:\vc\include\boost\smart_ptr\intrusive_ptr.hpp(233) : see declaration of 'boost::get_pointer' 1&gt; c:\vc\include\boost\smart_ptr\intrusive_ptr.hpp(233) : see declaration of 'boost::get_pointer' 1&gt;c:\vc\include\boost\bind\mem_fn_template.hpp(156): error C2784: 'optional&lt;T&gt;::pointer_type boost::get_pointer(boost::optional&lt;T&gt; &amp;)' : could not deduce template argument for 'boost::optional&lt;T&gt; &amp;' from 'std::shared_ptr&lt;_Ty&gt;' 1&gt; with 1&gt; [ 1&gt; _Ty=connection 1&gt; ] 1&gt; c:\vc\include\boost\optional\optional.hpp(741) : see declaration of 'boost::get_pointer' 1&gt; c:\vc\include\boost\optional\optional.hpp(741) : see declaration of 'boost::get_pointer' 1&gt;c:\vc\include\boost\bind\mem_fn_template.hpp(156): error C2784: 'optional&lt;T&gt;::pointer_const_type boost::get_pointer(const boost::optional&lt;T&gt; &amp;)' : could not deduce template argument for 'const boost::optional&lt;T&gt; &amp;' from 'std::shared_ptr&lt;_Ty&gt;' 1&gt; with 1&gt; [ 1&gt; _Ty=connection 1&gt; ] 1&gt; c:\vc\include\boost\optional\optional.hpp(733) : see declaration of 'boost::get_pointer' 1&gt; c:\vc\include\boost\optional\optional.hpp(733) : see declaration of 'boost::get_pointer' 1&gt;c:\vc\include\boost\bind\mem_fn_template.hpp(156): error C2784: 'T *boost::get_pointer(const boost::shared_ptr&lt;X&gt; &amp;)' : could not deduce template argument for 'const boost::shared_ptr&lt;X&gt; &amp;' from 'std::shared_ptr&lt;_Ty&gt;' 1&gt; with 1&gt; [ 1&gt; _Ty=connection 1&gt; ] 1&gt; c:\vc\include\boost\smart_ptr\shared_ptr.hpp(561) : see declaration of 'boost::get_pointer' 1&gt; c:\vc\include\boost\smart_ptr\shared_ptr.hpp(561) : see declaration of 'boost::get_pointer' 1&gt;c:\vc\include\boost\bind\mem_fn_template.hpp(156): error C2784: 'T *boost::get_pointer(const std::auto_ptr&lt;_Ty&gt; &amp;)' : could not deduce template argument for 'const std::auto_ptr&lt;_Ty&gt; &amp;' from 'std::shared_ptr&lt;_Ty&gt;' 1&gt; with 1&gt; [ 1&gt; _Ty=connection 1&gt; ] 1&gt; c:\vc\include\boost\get_pointer.hpp(25) : see declaration of 'boost::get_pointer' 1&gt; c:\vc\include\boost\get_pointer.hpp(25) : see declaration of 'boost::get_pointer' 1&gt;c:\vc\include\boost\bind\mem_fn_template.hpp(156): error C2784: 'T *boost::get_pointer(T *)' : could not deduce template argument for 'T *' from 'std::shared_ptr&lt;_Ty&gt;' 1&gt; with 1&gt; [ 1&gt; _Ty=connection 1&gt; ] 1&gt; c:\vc\include\boost\get_pointer.hpp(18) : see declaration of 'boost::get_pointer' 1&gt;c:\vc\include\boost\bind\mem_fn_template.hpp(156): error C2784: 'T *boost::get_pointer(const boost::reference_wrapper&lt;T&gt; &amp;)' : could not deduce template argument for 'const boost::reference_wrapper&lt;T&gt; &amp;' from 'std::shared_ptr&lt;_Ty&gt;' 1&gt; with 1&gt; [ 1&gt; _Ty=connection 1&gt; ] 1&gt; c:\vc\include\boost\ref.hpp(182) : see declaration of 'boost::get_pointer' 1&gt; c:\vc\include\boost\ref.hpp(182) : see declaration of 'boost::get_pointer' </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Peter Dimov</dc:creator> <pubDate>Wed, 31 Oct 2012 20:04:16 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4185#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4185#comment:3</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/81125" title="Add get_pointer overloads for std::unique_ptr, std::shared_ptr. Refs #4185.">[81125]</a>) Add get_pointer overloads for std::unique_ptr, std::shared_ptr. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4185" title="#4185: Bugs: VC10 std::shared_ptr not supported? (closed: fixed)">#4185</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Peter Dimov</dc:creator> <pubDate>Wed, 14 Nov 2012 11:20:35 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/4185#comment:4 https://svn.boost.org/trac10/ticket/4185#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/81329" title="Merged [81125] from trunk. Fixes #4185.">[81329]</a>) Merged <a class="changeset" href="https://svn.boost.org/trac10/changeset/81125" title="Add get_pointer overloads for std::unique_ptr, std::shared_ptr. Refs #4185.">[81125]</a> from trunk. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4185" title="#4185: Bugs: VC10 std::shared_ptr not supported? (closed: fixed)">#4185</a>. </p> Ticket