Re: [boost] Bind question, is there any way to implicitly go through a reference_wrapper?

"Peter Dimov" <pdimov@pdimov.com> wrote in message news:00c501c8e6b1$b3a11f60$6607a80a@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
participants (1)
-
Michael Goldshteyn