|
Boost : |
From: David B. Held (dheld_at_[hidden])
Date: 2002-07-09 12:13:56
"Giovanni Bajo" <giovannibajo_at_[hidden]> wrote in message
news:029e01c2272f$2096dfe0$7a4e2a97_at_bagio...
> [...]
> I'm not sure what this library would be useful for, as we already have
> _two_ bind implementations (Boost.Bind and Boost.Lambda), both
> with closure capabilities. Boost.Bind even works on all compilers
> around, including the cranky VC6.
> I understand that it solves the posted example quite nice, but I
> reckon that, in real life, it could have been written to avoid the (ugly
> imo) pointer to member function, just using the bind/function facilities,
> and with increased genericity too.
> [...]
Ok, I didn't notice that bind can take a shared_ptr directly. The
syntax isn't quite as nice as operator->*, IMO, but I suppose it works
just as well (I'm a sucker for syntactic sugar!). Is it possible to create
a global operator->* that takes a shared_ptr, and calls bind()? I
guess you would need a return value then, which is probably why we
have bind(), instead of shared_ptr::operator->*. Oh well.
Dave
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk