Boost logo

Boost Users :

From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-01-29 14:06:08


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;

In Christ,
Steven Watanabe


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