Subject: [Boost-bugs] [Boost C++ Libraries] #11306: bind added overload generate ambiguity
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-05-14 17:04:09
#11306: bind added overload generate ambiguity
-------------------------------+---------------------
Reporter: gerald.langlois@⦠| Owner: pdimov
Type: Bugs | Status: new
Milestone: To Be Determined | Component: bind
Version: Boost 1.58.0 | Severity: Problem
Keywords: |
-------------------------------+---------------------
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.
----
template<class Rt2, class R, class T,
class B1,
class A1, class A2>
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf1)<R, T, B1>, typename
_bi::list_av_2<A1, A2>::type>
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1), A1 a1, A2 a2)
template<class R, class T,
class B1,
class A1, class A2>
_bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(mf1)<R, T, B1>, typename
_bi::list_av_2<A1, A2>::type>
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1), A1 a1, A2 a2)
----
// Here is my use case that fail on my end
class any_function
{
public:
template <typename T0, typename T1, int i>
typename boost::enable_if<
boost::is_member_function_pointer<T0>,
CAnyFunction&>::type
set(T0 t0, T1 t1, boost::arg<i> i1)
{
typedef function_traits<T0> traits;
typedef typename traits::result_type result_type;
Functor =
boost::function<result_type (traits::arg1_type)>
(boost::bind<result_type>(t0, t1, i1));
return *this;
};
private:
boost::any Functor;
}
----
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/11306> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:18 UTC