From 17df366d200d59dfa73cf7f2081eceba37f2df56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaakko=20J=C3=A4rvi?= Date: Mon, 13 Sep 2004 15:13:59 +0000 Subject: [PATCH] added explicit qualification to var to avoid conflict with pthreads [SVN r25042] --- test/control_structures.cpp | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/test/control_structures.cpp b/test/control_structures.cpp index b4cf3ae..b737ff9 100644 --- a/test/control_structures.cpp +++ b/test/control_structures.cpp @@ -22,7 +22,18 @@ #include using namespace boost; -using namespace boost::lambda; + +using boost::lambda::constant; +using boost::lambda::_1; +using boost::lambda::_2; +using boost::lambda::_3; +using boost::lambda::make_const; +using boost::lambda::for_loop; +using boost::lambda::while_loop; +using boost::lambda::do_while_loop; +using boost::lambda::if_then; +using boost::lambda::if_then_else; +using boost::lambda::if_then_else_return; // 2 container for_each template @@ -42,7 +53,7 @@ void simple_loops() { BOOST_TEST(arithmetic_series == 45); // no body case - for_loop(var(i) = 0, var(i) < 100, ++var(i))(); + for_loop(boost::lambda::var(i) = 0, boost::lambda::var(i) < 100, ++boost::lambda::var(i))(); BOOST_TEST(i == 100); // while loops ------------------------------------------------------- @@ -53,12 +64,12 @@ void simple_loops() { int count; count = 0; i = 0; - while_loop(_1++ < 10, ++var(count))(i); + while_loop(_1++ < 10, ++boost::lambda::var(count))(i); BOOST_TEST(count == 10); // note that the first parameter of do_while_loop is the condition count = 0; i = 0; - do_while_loop(_1++ < 10, ++var(count))(i); + do_while_loop(_1++ < 10, ++boost::lambda::var(count))(i); BOOST_TEST(count == 11); a = 0; @@ -89,11 +100,11 @@ void simple_ifs () { BOOST_TEST(value == 42); int min; - if_then_else(_1 < _2, var(min) = _1, var(min) = _2) + if_then_else(_1 < _2, boost::lambda::var(min) = _1, boost::lambda::var(min) = _2) (make_const(1), make_const(2)); BOOST_TEST(min == 1); - if_then_else(_1 < _2, var(min) = _1, var(min) = _2) + if_then_else(_1 < _2, boost::lambda::var(min) = _1, boost::lambda::var(min) = _2) (make_const(5), make_const(3)); BOOST_TEST(min == 3);