Boost logo

Boost Users :

Subject: Re: [Boost-users] Valgrind false positive in make_shared
From: Peter Dimov (pdimov_at_[hidden])
Date: 2010-11-17 12:34:53


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. :-/


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net