Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2003-11-20 17:43:57


Christopher Currie wrote:
> Peter Dimov wrote:
>> template<class F> void bind(F f);
>> template<class R, class T> void bind(R T::* pm) {}
>>
>> struct X { int i; };
>>
>> int main() { bind(&X::i); }
>>
>> If it chooses bind(F f) and fails to link, then that's another bug,
>> one that we can "work around" by disabling data member pointer
>> support on Sun CC. I'm not sure that we need a new macro, though,
>> this seems pretty Sun-specific.
>
> Unfortunately(?), this case compiles and links just fine, so there's
> something else at work. I've been trying to narrow down a test case
> for the bind_test failure, but it's not immediately obvious to me which
> bind<> overload the compiler is actually selecting.

That's odd. This is the line that fails:

    BOOST_TEST( bind(&X::hash, _1)(x) == 23558 );

and the error message seems to indicate that the overload

template<class F, class A1>
    _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_1<A1>::type>
    BOOST_BIND(F f, A1 a1)

is (incorrectly) preferred over

template<class R, class T, class A1>
_bi::bind_t< R const &, _mfi::dm<R, T>, typename _bi::list_av_1<A1>::type >
    BOOST_BIND(R T::*f, A1 a1)


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk