Boost logo

Boost Users :

Subject: Re: [Boost-users] correct usage of bind (pls ignore last email)
From: Sandeep Gupta (gupta.sandeep_at_[hidden])
Date: 2009-03-17 20:19:05


That is indeed so. Thanks Steve.

On Tue, Mar 17, 2009 at 3:40 PM, Steven Watanabe <watanabesj_at_[hidden]> wrote:
> AMDG
>
> Sandeep Gupta wrote:
>>
>> template<typename X, typename Y>
>> std::pair<X, Y> buildPair(X x, Y y);
>>
>> int main()
>> {
>>  typedef boost::function<void (std::pair<int,int>)> FuncType1_t;
>>  FuncType1_t ft1;
>>
>>  typedef boost::function<void(std::pair<int,int>)> FuncType2_t;
>>  FuncType2_t ft2 =  bind(ft1, bind(buildPair<int,int>,_1,_2));
>> }
>>
>> This fails. The problem however vanished if I replace the declaration
>> "FuncType3 ft2..."  with
>>  bind(ft1, bind(buildPair<int,int>,_1,_2))(3,5);
>>
>> So my question is what is correct type of  bind(ft1,
>> bind(buildPair<int,int>,_1,_2));
>>
>
> Since it is a function which takes two ints,
> the correct type is
>
> boost::function<void(int, int)>
>
> In Christ,
> Steven Watanabe
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


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