From b33ce64895c6519a281085afdc16d599e046e480 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Sat, 2 Jun 2007 16:48:49 +0000 Subject: [PATCH] correcting defective fusion count_if test case [SVN r37874] --- test/algorithm/count_if.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/algorithm/count_if.cpp b/test/algorithm/count_if.cpp index fa686fc2..1a8c02e5 100644 --- a/test/algorithm/count_if.cpp +++ b/test/algorithm/count_if.cpp @@ -11,6 +11,7 @@ #include #include #include +#include int main() @@ -27,8 +28,9 @@ main() { typedef boost::mpl::vector_c mpl_vec; - BOOST_TEST(boost::fusion::count_if(mpl_vec(), boost::lambda::_1 <= 2) == 2); - BOOST_TEST(boost::fusion::count_if(mpl_vec(), boost::lambda::_1 > 2) == 1); + // Cannot use lambda here as mpl iterators return rvalues and lambda needs lvalues + BOOST_TEST(boost::fusion::count_if(mpl_vec(), std::bind2nd(std::less_equal(), 2)) == 2); + BOOST_TEST(boost::fusion::count_if(mpl_vec(), std::bind2nd(std::greater(), 2)) == 1); } return boost::report_errors();