Boost C++ Libraries: Ticket #11306: bind added overload generate ambiguity https://svn.boost.org/trac10/ticket/11306 <p> When providing an explicit return type when the function result_type may or may not be deduced. If the result type is the same than the one requested by the generated function, the two template specialization become valid and then create ambiguity. </p> <hr /> <p> template&lt;class Rt2, class R, class T, </p> <blockquote> <p> class B1, class A1, class A2&gt; _bi::bind_t&lt;Rt2, _mfi::BOOST_BIND_MF_NAME(mf1)&lt;R, T, B1&gt;, typename _bi::list_av_2&lt;A1, A2&gt;::type&gt; BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1), A1 a1, A2 a2) </p> </blockquote> <p> template&lt;class R, class T, </p> <blockquote> <p> class B1, class A1, class A2&gt; _bi::bind_t&lt;R, _mfi::BOOST_BIND_MF_NAME(mf1)&lt;R, T, B1&gt;, typename _bi::list_av_2&lt;A1, A2&gt;::type&gt; BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1), A1 a1, A2 a2) </p> </blockquote> <hr /> <p> <em> Here is my use case that fail on my end </em></p> <p> class any_function { public: </p> <p> template &lt;typename T0, typename T1, int i&gt; typename boost::enable_if&lt; </p> <blockquote> <p> boost::is_member_function_pointer&lt;T0&gt;, CAnyFunction&amp;&gt;::type </p> </blockquote> <p> set(T0 t0, T1 t1, boost::arg&lt;i&gt; i1) { </p> <blockquote> <p> typedef function_traits&lt;T0&gt; traits; typedef typename traits::result_type result_type; Functor = </p> <blockquote> <p> boost::function&lt;result_type (traits::arg1_type)&gt; (boost::bind&lt;result_type&gt;(t0, t1, i1)); </p> </blockquote> <p> return *this; </p> </blockquote> <p> }; </p> <p> private: </p> <blockquote> <p> boost::any Functor; </p> </blockquote> <p> } </p> <hr /> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11306 Trac 1.4.3 gerald.langlois@… Thu, 14 May 2015 17:08:34 GMT attachment set https://svn.boost.org/trac10/ticket/11306 https://svn.boost.org/trac10/ticket/11306 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">bind.patch</span> </li> </ul> <p> I used boost::disable to remove ambiguity and had to include files in another header since the one in which I had to do the fix is not included from the global namespace </p> Ticket Alex Merry <alexander.merry@…> Thu, 28 May 2015 10:25:38 GMT <link>https://svn.boost.org/trac10/ticket/11306#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11306#comment:1</guid> <description> <p> You may get a better response submitting a pull request at <a class="ext-link" href="https://github.com/boostorg/bind"><span class="icon">​</span>https://github.com/boostorg/bind</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Peter Dimov</dc:creator> <pubDate>Thu, 28 May 2015 12:02:41 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11306#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11306#comment:2</guid> <description> <p> This has already been fixed in Git. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Peter Dimov</dc:creator> <pubDate>Thu, 28 May 2015 12:04:39 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/11306#comment:3 https://svn.boost.org/trac10/ticket/11306#comment:3 <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">duplicate</span> </li> </ul> <p> Duplicate of <a class="new ticket" href="https://svn.boost.org/trac10/ticket/11304" title="#11304: Bugs: bind added overload generate ambiguity (new)">#11304</a>. </p> Ticket