From: Terence Wilson (tez_at_[hidden])
Date: 2002-06-17 20:11:38
I actually had the cast syntax right, however, I had mismatched the
return type. I double-checked after reading your message and found the
error. It now compiles.
[mailto:boost-bounces_at_[hidden]] On Behalf Of David Abrahams
Sent: Monday, June 17, 2002 5:21 PM
Subject: Re: [boost] Quickie- How to use bind with an overloaded member?
From: "Terence Wilson" <tez_at_[hidden]>
> Given a class:
> class Thing
> DoIt(int x);
> DoIt(std::string str);
Hmm, what are the return types?
> Here is my (incorrect) code for calling DoIt with every string in
> Thing myThing;
> std::vector myVec;
> std::for_each(myVec.begin(), myVec.end(), boost::bind(&Thing::DoIt,
> &myThing, _1));
> The sticking point seems to be the overloaded DoIt. How do I clear up
> the ambiguity?
You gotta cast :(
Where R is the return type.
Unsubscribe & other changes:
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk