17 Nov
2010
17 Nov
'10
5:34 p.m.
Frank Mori Hess wrote:
On Tuesday 16 November 2010, Peter Dimov wrote:
Interesting... which version of GCC? Without the static_cast, it shouldn't compile, as rvalue references no longer bind to lvalues. In fact, I see that I added the static_cast in [61574] for that very reason.
$ gcc --version gcc (Debian 4.3.2-1.1) 4.3.2
Its implementation of std::forward looks like:
template<typename _Tp> inline _Tp&& forward(typename std::identity<_Tp>::type&& __t) { return __t; }
So it appears that we need to revert to the old forward for 4.3 and earlier. The easiest would be to just use std::forward, but unfortunately, I remember that some earlier versions of the standard library didn't have it. :-/