Aleksey Gurtovoy wrote:
So, the corrected example would be:
class widget
{
public:
// ...
typedef boost::function bool_arg_t;
self_t& is_enabled(bool_arg_t a_enabled); // note the
signature!
bool is_enabled() const;
};
int main()
{
widget w;
w.is_enabled(true); // ordinary syntax/semantics
assert(w.is_enabled())
widget w2;
w.is_enabled(boost::bind(&widget::is_enabled, &w2)); // here!
w2.is_enabled(false);
assert(!w.is_enabled()) // !
}
I hope the name change makes the semantics of the above clearer.
I still don't get it. Have I used to few widget libraries? ;)
Dirk Gerrits
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost