
On Apr 7, 2008, at 2:30 PM, Anthony Williams wrote:
"Peter Dimov" <pdimov@pdimov.com> writes:
Anthony Williams:
"Peter Dimov" <pdimov@pdimov.com> writes:
Anthony Williams:
"Peter Dimov" <pdimov@pdimov.com> writes:
Eric Niebler:
> Can you write what the identity function object would look > like in > C++0x?
struct identity { template<class A> A operator()( A && a ) const { return std::forward<A>( a ); } };
I guess.
No. That will convert lvalues to rvalues.
Try it.
I have, and it doesn't work.
With what compiler does it not work? Can you post the example program?
It's a pre-release compiler. I can't tell you which one as I'm under an NDA.
IIRC, GCC 4.3.0 should deal with this correctly. And if it doesn't, please file a bug report. - Doug