|
Boost : |
From: Michael Goldshteyn (mgoldshteyn_at_[hidden])
Date: 2008-07-15 15:50:31
"Peter Dimov" <pdimov_at_[hidden]> wrote in message
news:00c501c8e6b1$b3a11f60$6607a80a_at_pdimov2...
>
> It doesn't because of the mem_fn behavior that bind inherits. The
> argument is not a reference to Crayon and so is assumed to be a smart
> pointer to Crayon. mem_fn then tries to invoke get_pointer() on it to
obtain a Crayon*.
> You should be able to make it compile by adding a get_pointer overload
> for
> reference_wrapper:
>
> namespace boost
> {
>
> template<class T> T* get_pointer( reference_wrapper<T> const & r ) {
> return r.get_pointer();
> }
>
> }
That would be an awesome addition, since reference_wrapper is an oft-used
part of boost and there's really no reason for it not to be automatically
traversed, making bind constructs that involve it a little simpler.
Thanks,
Michael Goldshteyn
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk