Boost logo

Boost Users :

Subject: Re: [Boost-users] [bind] Pointer as third parameter
From: Jean-Pierre Bergamin (james_at_[hidden])
Date: 2008-12-18 08:59:36


Peter Dimov schrieb:
> Jean-Pierre Bergamin:
> ...
>
>>>> f(a, b, &c);
>
> ...
>
>> I just found out that it works with boost 1.37 on MSVC 8, but not
>> with 1.34.1.
>> Any clue how to get this working with 1.34.1 (since 1.37 is not
>> avaialable for FreeBSD yet)?
>
> The problem is that, in 1.34, 'f' doesn't accept non-const rvalues
> (temporaries). You can fix that with
>
> int * pc = &c;
> f( a, b, pc );
>
> or with
>
> f( a, b, static_cast< int* const& >( &c ) );
>
Thank you. That solves this issue.

Strange enough that the non-const rvalue works for the function that
only takes two parameters f(a, &b).
But anyway. I'm happy that it works this way.

James


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