|
Boost Users : |
Subject: Re: [Boost-users] [bind] Pointer as third parameter
From: Jean-Pierre Bergamin (james_at_[hidden])
Date: 2008-12-18 08:20:28
Jeff Flinn schrieb:
> Jean-Pierre Bergamin wrote:
>> I'm having problems with calling a function that takes a pointer as
>> the third argument through bind.
>> I cannot explain, why the code below does not compile with the
>> function 'op3' enabled. When changing f3 to void f3(int a, int b, int
>> c) { } it also works. I don't see any reasony why this should fail,
>> since f2 also works.
>>
>> Any ideas how to solve this?
>>
>> // ---------------------------------------
>> void f3(int a, int b, int *c) { }
>> void f2(int a, int *b) { }
>>
>> template <typename F> void op3(F f) {
>> int a = 1, b = 2, c = 3;
>> f(a, b, &c);
>> }
>>
>> template <typename F> void op2(F f) {
>> int a = 1, b = 2;
>> f(a, &b);
>> }
>>
>> void call() {
>> op2(boost::bind(&f2, _1, _2));
>> //op3(boost::bind(&f3, _1, _2, _3));
>> }
>> // ---------------------------------------
>
> Works for me on MSVC 8 w/ 64bit disabled.
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)?
Regards
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