|
Boost Users : |
From: Jeff Flinn (TriumphSprint2000_at_[hidden])
Date: 2008-01-29 17:03:15
Steven Watanabe wrote:
> AMDG
>
> Joseph Fradley wrote:
>> Steven,
>>
>> Thank you, I'm trying it now. But I'm a confused as to what type of
>> map to create from your line :
>> map_.insert(std::make_pair("corner", &boost::bind(&Rectangle::corner, _1)));
>>
>> I've just now read up on boost::bind and I can only see documentation
>> of binding to member functions not member data. Could you elaborate?
>>
>> Joe
>
> boost::function<Point&(Rectangle*)> f = boost::bind(&Rectangle::corner, _1);
>
> Rectangle rect;
>
> Point p = f(&rect); // equivalent to p = f.corner;
I think you meant: // equivalent to rect.corner
Jeff Flinn
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net