Boost logo

Boost :

From: Jonathan Turkanis (technews_at_[hidden])
Date: 2004-11-18 01:03:47


"Daryle Walker" <darylew_at_[hidden]> wrote in message
news:BAY16-DAV11C01AF63D07C2AE25621DBFC10_at_phx.gbl...
> On 11/9/04 9:18 PM, "Jonathan Turkanis" <technews_at_[hidden]> wrote:

> > There's one change I'd like to see: the constructors should take rvalue
> > references ;-)
>
> But that would prevent lvalue references from ever being used.

I was kidding, of course, since we don't have rvalue references yet; but under
the current proposal, the correct way to write forwarding functions would be to
have all the functions parameters declared as rvalue references. (See
http://tinyurl.com/62smc.)

> However,
> since we can't explicitly specify the template parameters for a templated
> constructor, could reference arguments (of either type) ever be used?

Forwarding constructors which take arguments by reference should generally use
const references. (See #2 of http://tinyurl.com/6enrw.) I wouldn't want to
suggest that you switch to const references at this point, because I can't say
it wouldn't break some existing code. (Someone else can probably say.)

Jonathan


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