Boost logo

Boost Testing :

Subject: Re: [Boost-testing] A question on lambda under Dev-C++.Can anyone with kindness help me?
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-06-27 00:32:59


AMDG

fmingu wrote:
> By using Dev-C++ 4.9.8.0,I used boost::lambda£¬and the program contains the following lines£º
> ..........
> typedef std::pair <int, int> mypair;
> bind(&mypair,1,6);
> ...................
> but the complier told me that£º
>
> parse error before `,' token
>
> but when I use
> mypair£¨1£¬6£©£»instead of bind(&mypair,1,6); then everything is ok.
> Can anyone with kindness tell me why and how to solve it by using the function bind ?
>

mypair is a type, not a function so you can't take its address.
Use boost::lambda::constructor. http://tinyurl.com/ogjs8n.

bind(constructor<mypair>(), 1, 6);

In Christ,
Steven Watanabe

P.S. In the future, please ask such questions on the boost-users list.


Boost-testing list run by mbergal at meta-comm.com