
18 Dec
2008
18 Dec
'08
1:59 p.m.
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