|
Boost : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-07-10 06:04:01
From: "Giovanni Bajo" <giovannibajo_at_[hidden]>
> From: "Peter Dimov" <pdimov_at_[hidden]>
>
> > The function<> is used only to name the return type
>
> Nice trick, didn't think of it.
>
> > (and to get around the forwarding problem - bind() things don't take
> rvalues as arguments.)
>
> which is annoying, in times. I suppose there is no way to get around this
> limitation, right?
There are two ways, one impractical (T & / T const & overloading, 512 in
total for nine arguments, doesn't work reliably across compilers) and one
evil (taking parameters by T const &, const_cast inside.)
Hopefully the next C++ will offer a solution.
> > In a better C++ this would have been
> >
> > template<class T, class R, class U> typeof( bind(pmf, p) )
> > operator->*(shared_ptr<T> const & p, R (U::*pmf) ())
> > {
> > return bind(pmf, p);
> > }
> > but I digress. ;-)
>
> Yeah, even if in this specific case we still get the rvalue issues, in
this
> way, that doesn't match the expected operator->* syntax. But typeof()
would
> be so cool ...
In a better C++ bind would take rvalues. :-)
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk