From 564280e6223ceeafcf037a63e3b7d090732ec876 Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Thu, 20 Aug 2009 14:01:39 +0000 Subject: [PATCH] Make the unrolled implementation of all work for multiples of four. Fixes #2599. [SVN r55686] --- include/boost/fusion/algorithm/query/detail/all.hpp | 2 +- test/algorithm/all.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/include/boost/fusion/algorithm/query/detail/all.hpp b/include/boost/fusion/algorithm/query/detail/all.hpp index 979cfb11..51fd393f 100644 --- a/include/boost/fusion/algorithm/query/detail/all.hpp +++ b/include/boost/fusion/algorithm/query/detail/all.hpp @@ -108,7 +108,7 @@ namespace boost { namespace fusion { namespace detail template static bool call(It const& it, F f) { - return false; + return true; } }; diff --git a/test/algorithm/all.cpp b/test/algorithm/all.cpp index 47c65e50..a4c7f32c 100644 --- a/test/algorithm/all.cpp +++ b/test/algorithm/all.cpp @@ -33,12 +33,24 @@ namespace int main() { + { + boost::fusion::vector<> t; + BOOST_TEST((boost::fusion::all(t, boost::lambda::_1 < 4))); + BOOST_TEST((boost::fusion::all(t, boost::lambda::_1 > 0))); + } + { boost::fusion::vector t(1, 2, 3.3); BOOST_TEST((boost::fusion::all(t, boost::lambda::_1 < 4))); BOOST_TEST((boost::fusion::all(t, boost::lambda::_1 > 0))); } + { + boost::fusion::vector t(1, 2, 3.3, 2); + BOOST_TEST((boost::fusion::all(t, boost::lambda::_1 < 4))); + BOOST_TEST((boost::fusion::all(t, boost::lambda::_1 > 0))); + } + { boost::fusion::vector t(1, 2, 3.3); BOOST_TEST((!boost::fusion::all(t, boost::lambda::_1 == 1)));