Boost logo

Boost :

Subject: Re: [boost] [interprocess] Compile problem with 1.39 and trunk
From: Thomas Klimpel (Thomas.Klimpel_at_[hidden])
Date: 2009-08-26 11:37:46

Mathias Gaunard wrote:
> Thomas Klimpel wrote:
> > Until recently, I thought that the "perfect forwarding" problem was a technical defect of C++03, but then I read through the following:
> Perfect forwarding works just fine (for a certain definition of fine) in
> C++03, it just requires an exponential number of overloads as the number
> of arguments increases and doesn't forward rvalue-ness but only types
> and const-ness, but since C++03 can't officially detect rvalue-ness
> anyway that's irrelevant.

Perfect forwarding in C++03 works just fine for references and const-references, but it doesn't work fine for a function that takes it's arguments by value. You can try to approximate it by using a const reference, but then you loose rvalue-ness.

> >>
> I don't really see how that article has a link to perfect forwarding.

The article explains "copy elision" and RVO, and hence explains why taking argument by value is closely related to rvalue-ness. So it shows why the statement "..., but since C++03 can't officially detect rvalue-ness anyway that's irrelevant" is not the complete truth.


Boost list run by bdawes at, gregod at, cpdaniel at, john at