From 39eda970d55130be1f85097c8e0f5596f15db849 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaakko=20J=C3=A4rvi?= Date: Fri, 19 Apr 2002 19:39:44 +0000 Subject: [PATCH] no need to use unlambda anymore [SVN r13530] --- test/bll_and_function.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/test/bll_and_function.cpp b/test/bll_and_function.cpp index e6e4fb1..4494f6e 100644 --- a/test/bll_and_function.cpp +++ b/test/bll_and_function.cpp @@ -22,16 +22,12 @@ using namespace std; void test_function() { boost::function f; - f = unlambda(_1 + _2); - - // unlambda must be used, because boost::function tries to take the - // address of the function object that is assigned. However, the - // operator& is overloaded for lambda functors, which creates a conflict + f = _1 + _2; BOOST_TEST(f(1, 2)== 3); int i=1; int j=2; - boost::function g = unlambda(_1 += _2); + boost::function g = _1 += _2; g(i, j); BOOST_TEST(i==3); @@ -39,7 +35,7 @@ void test_function() { int* sum = new int(); *sum = 0; - boost::function counter = unlambda(*sum += _1); + boost::function counter = *sum += _1; counter(5); // ok, sum* = 5; BOOST_TEST(*sum == 5); delete sum;