Boost C++ Libraries: Ticket #3856: ambiguities with make_shared() function pointers with C++0x https://svn.boost.org/trac10/ticket/3856 <p> Trying to store a function pointer to make_shared&lt;Arg1&gt; results in ambiguity errors in gcc (4.3.) with C++0x support being enabled. </p> <p> The following: </p> <blockquote> <p> typedef boost::shared_ptr&lt;int&gt;(*FP)();<br /> FP fp = boost::make_shared&lt;int&gt;; </p> </blockquote> <p> leads to: </p> <p> error: converting overloaded function ‘make_shared’ to type ‘class boost::shared_ptr&lt;int&gt; (*)()’ is ambiguous<br /> boost_1_41_0/boost/smart_ptr/make_shared.hpp:100: error: candidates are: boost::shared_ptr&lt;X&gt; boost::make_shared() [with T = int]<br /> boost_1_41_0/boost/smart_ptr/make_shared.hpp:138: error: boost::shared_ptr&lt;X&gt; boost::make_shared(Args&amp;&amp; ...) [with T = int, Args = ]<br /> </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3856 Trac 1.4.3 Georg Fritzsche <georg.fritzsche@…> Fri, 22 Jan 2010 21:27:50 GMT attachment set https://svn.boost.org/trac10/ticket/3856 https://svn.boost.org/trac10/ticket/3856 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">test_make_shared.cpp</span> </li> </ul> <p> simple test case </p> Ticket georg.fritzsche@… Sun, 31 Jan 2010 01:16:20 GMT component changed; owner set https://svn.boost.org/trac10/ticket/3856#comment:1 https://svn.boost.org/trac10/ticket/3856#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Peter Dimov</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">smart_ptr</span> </li> </ul> Ticket Peter Dimov Sun, 31 Jan 2010 14:16:53 GMT <link>https://svn.boost.org/trac10/ticket/3856#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3856#comment:2</guid> <description> <p> I can remove the nullary overload, but this will make the test at source:trunk/libs/smart_ptr/test/make_shared_test.cpp#L57 to fail on gcc 4.3.x (and maybe some 4.4 versions, I haven't checked.) </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Peter Dimov</dc:creator> <pubDate>Wed, 26 May 2010 18:18:14 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3856#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3856#comment:3</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/62248" title="Resolve the ambiguity between the zero argument make_shared and the ...">[62248]</a>) Resolve the ambiguity between the zero argument make_shared and the variadic one. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3856" title="#3856: Bugs: ambiguities with make_shared() function pointers with C++0x (closed: fixed)">#3856</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Peter Dimov</dc:creator> <pubDate>Sat, 10 Jul 2010 21:17:42 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/3856#comment:4 https://svn.boost.org/trac10/ticket/3856#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/63827" title="Merge [62248] to release. Fixes #3856.">[63827]</a>) Merge <a class="changeset" href="https://svn.boost.org/trac10/changeset/62248" title="Resolve the ambiguity between the zero argument make_shared and the ...">[62248]</a> to release. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3856" title="#3856: Bugs: ambiguities with make_shared() function pointers with C++0x (closed: fixed)">#3856</a>. </p> Ticket