Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::bind issues
From: Igor R (boost.lists_at_[hidden])
Date: 2012-10-09 02:52:25


> OlcStringEntry(const std::string &name, FLAG flag, StringGetter& get, StringSetter& set);

Do you really want to pass getter/setter by (non-const) reference?
If so, you can't pass binders, you should first create boost::function
objects and pass them:
StringGetter getter = bind(&BaseObject::GetName, this);
OlcStringEntry(..., getter,...);

Of course, pay attention to the getter/setter objects lifetime.


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