
On 6/20/2010 11:00 AM, David Abrahams wrote:
At Sun, 20 Jun 2010 16:21:14 +0200, Thomas Klimpel wrote:
[1] It's not really about "perfect forwarding", but about capturing the non-const rvalue references. This is required for handling calls using adapters like "lapack::syev(bindings::lower(A), w);".
I'm just curious, Have you thought about using const rvalues as return types in these situations? If you consider the adapter itself to be immutable and the target sequence to be a separate object (which in reality it is), it actually all makes sense. And a T const return type will bind nicely to a generalized U& argument.
Interesting to hear you recommending this practice. I use it extensively in Proto but have felt like a bad citizen for doing it because I've heard that practice proscribed by various experts and committee members. -- Eric Niebler BoostPro Computing http://www.boostpro.com