Boost logo

Boost :

From: urzuga (jajarvi_at_[hidden])
Date: 2001-12-13 11:05:50


> For the record, here's my suggestion for a core change:
>
> "For the purposes of reference binding, all rvalues are considered
const."

I'd rather go and remove the restriction, that references cannot be
bound to nonconst temporaries.

It is kind of an inconsistent rule anyway:

class A { void foo(); }
void foo(A& a);

A bar();

bar().foo(); // ok
foo(bar()); // not ok

The way I see it, both are trying to bind a reference to a non-const
temporary.

Jaakko


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk