lambda lib & mingw gcc 2.95.2?
Hi all Does the lambda library compile under mingw with gcc 2.95.2? I'm a newbie and I can't figure out what's wrong with the following test example: #include <boost/lambda/bind.hpp> #include <boost/lambda/lambda.hpp> using namespace boost; using namespace boost::lambda; struct A { int d; }; int main (int argc, int argv[]) { A* a = new A(); int b = (a ->* &A::d); int c = (_1 ->* &A::d)(a); return c - b; } g++ test.cpp -Wall -Ix:/boost_1_28_0/ -D__PROCESSOR_X86__ -D__WIN32__ -D__GCC__ -o test.o test.cpp: In function `int main(int, int *)': test.cpp:12: no match for `const boost::lambda::lambda_functor<boost::lambda::pl aceholder<1> > & ->* int A::*' make: *** [test.exe] Error 1 Would appreciate any clues. ;-) Mynhard
Hi,
Does the lambda library compile under mingw with gcc 2.95.2? I'm a newbie and I can't figure out what's wrong with the following test example:
It's a compiler bug. Works with gcc 2.96 and upwards. The bind syntax has been extended after Peter Dimov's bind library to support binding of member variables, and this seems to work with 2.95.2 This feature is not in release 1.28 of boost, but will be in 1.29 Form lambda docs (in CVS) -------------------------------- 5.3.3. Member variables as targets A pointer to a member variable is not really a function, but the first argument to the bind function can nevertheless be a pointer to a member variable. Invoking such a bind expression returns a reference to the data member. For example: struct A { int data; }; A a; bind(&A::data, _1)(a) = 1; // a.data == 1 ----------------------------------- Cheers, Jaakko
#include <boost/lambda/bind.hpp> #include <boost/lambda/lambda.hpp> using namespace boost; using namespace boost::lambda;
struct A { int d; };
int main (int argc, int argv[]) { A* a = new A(); int b = (a ->* &A::d); int c = (_1 ->* &A::d)(a); return c - b; }
g++ test.cpp -Wall -Ix:/boost_1_28_0/ -D__PROCESSOR_X86__ -D__WIN32__ -D__GCC__ -o test.o test.cpp: In function `int main(int, int *)': test.cpp:12: no match for `const boost::lambda::lambda_functor<boost::lambda::pl aceholder<1> > & ->* int A::*' make: *** [test.exe] Error 1
Would appreciate any clues. ;-)
Mynhard
Info: <http://www.boost.org> Wiki: <http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl> Unsubscribe: <mailto:boost-users-unsubscribe@yahoogroups.com>
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
-- -- -- Jaakko Järvi email: jajarvi@cs.indiana.edu -- Post Doctoral Fellow phone: +1 (812) 855-3608 -- Pervasive Technology Labs fax: +1 (812) 855-4829 -- Indiana University, Bloomington
Thanks Jaakko
Does the lambda library compile under mingw with gcc 2.95.2? I'm a newbie and I can't figure out what's wrong with the following test example:
It's a compiler bug. Works with gcc 2.96 and upwards.
The bind syntax has been extended after Peter Dimov's bind library to support binding of member variables, and this seems to work with 2.95.2 This feature is not in release 1.28 of boost, but will be in 1.29
I'll hunt a bit for a version of mingw with gcc 2.96. The latest mingw uses gcc 3.2, which is not supported by boost 1.28. When will boost 1.29 be available? Cheers Mynhard
I'll hunt a bit for a version of mingw with gcc 2.96. The latest mingw uses gcc 3.2, which is not supported by boost 1.28. When will boost 1.29 be available?
The CVS-branch for 1.29 will be created today, so around two weeks, if all go as planned. Jaakko
participants (2)
-
Jaakko Jarvi
-
Mynhard Rudolph