Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r55686 - in trunk: boost/fusion/algorithm/query/detail libs/fusion/test/algorithm
From: steven_at_[hidden]
Date: 2009-08-20 10:01:39


Author: steven_watanabe
Date: 2009-08-20 10:01:39 EDT (Thu, 20 Aug 2009)
New Revision: 55686
URL: http://svn.boost.org/trac/boost/changeset/55686

Log:
Make the unrolled implementation of all work for multiples of four. Fixes #2599.
Text files modified:
   trunk/boost/fusion/algorithm/query/detail/all.hpp | 2 +-
   trunk/libs/fusion/test/algorithm/all.cpp | 12 ++++++++++++
   2 files changed, 13 insertions(+), 1 deletions(-)

Modified: trunk/boost/fusion/algorithm/query/detail/all.hpp
==============================================================================
--- trunk/boost/fusion/algorithm/query/detail/all.hpp (original)
+++ trunk/boost/fusion/algorithm/query/detail/all.hpp 2009-08-20 10:01:39 EDT (Thu, 20 Aug 2009)
@@ -108,7 +108,7 @@
         template <typename It, typename F>
         static bool call(It const& it, F f)
         {
- return false;
+ return true;
         }
     };
 

Modified: trunk/libs/fusion/test/algorithm/all.cpp
==============================================================================
--- trunk/libs/fusion/test/algorithm/all.cpp (original)
+++ trunk/libs/fusion/test/algorithm/all.cpp 2009-08-20 10:01:39 EDT (Thu, 20 Aug 2009)
@@ -34,12 +34,24 @@
 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<int, short, double> 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<int, short, double, long> 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<int, short, double> t(1, 2, 3.3);
         BOOST_TEST((!boost::fusion::all(t, boost::lambda::_1 == 1)));
         BOOST_TEST((!boost::fusion::all(t, boost::lambda::_1 < 3)));


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk