Boost C++ Libraries: Ticket #11308: bind added overload generate ambiguity https://svn.boost.org/trac10/ticket/11308 <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/11308 Trac 1.4.3 gerald.langlois@… Thu, 14 May 2015 17:11:24 GMT attachment set https://svn.boost.org/trac10/ticket/11308 https://svn.boost.org/trac10/ticket/11308 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">bind.patch</span> </li> </ul> <p> Using boost::disable to remove ambiguity </p> Ticket gerald.langlois@… Thu, 14 May 2015 17:13:25 GMT attachment set https://svn.boost.org/trac10/ticket/11308 https://svn.boost.org/trac10/ticket/11308 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">bind.2.patch</span> </li> </ul> <p> Using boost::disable to remove ambiguity </p> Ticket gerald.langlois@… Thu, 14 May 2015 17:13:26 GMT attachment set https://svn.boost.org/trac10/ticket/11308 https://svn.boost.org/trac10/ticket/11308 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">bind.3.patch</span> </li> </ul> <p> Using boost::disable to remove ambiguity </p> Ticket gerald.langlois@… Thu, 14 May 2015 17:13:26 GMT attachment set https://svn.boost.org/trac10/ticket/11308 https://svn.boost.org/trac10/ticket/11308 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">bind.4.patch</span> </li> </ul> <p> Using boost::disable to remove ambiguity </p> Ticket gerald.langlois@… Thu, 14 May 2015 17:13:27 GMT attachment set https://svn.boost.org/trac10/ticket/11308 https://svn.boost.org/trac10/ticket/11308 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">bind.5.patch</span> </li> </ul> <p> Using boost::disable to remove ambiguity </p> Ticket Peter Dimov Thu, 28 May 2015 12:05:27 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/11308#comment:1 https://svn.boost.org/trac10/ticket/11308#comment:1 <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