Boost C++ Libraries: Ticket #11304: bind added overload generate ambiguity https://svn.boost.org/trac10/ticket/11304 <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/11304 Trac 1.4.3 Peter Dimov Thu, 14 May 2015 17:10:20 GMT <link>https://svn.boost.org/trac10/ticket/11304#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11304#comment:1</guid> <description> <p> This was fixed recently by <a class="ext-link" href="https://github.com/boostorg/bind/pull/11"><span class="icon">​</span>https://github.com/boostorg/bind/pull/11</a>. </p> </description> <category>Ticket</category> </item> </channel> </rss>