Make the unrolled implementation of all work for multiples of four. Fixes #2599.

[SVN r55686]
This commit is contained in:
Steven Watanabe
2009-08-20 14:01:39 +00:00
parent 2e33d288b1
commit 564280e622
2 changed files with 13 additions and 1 deletions

View File

@ -108,7 +108,7 @@ namespace boost { namespace fusion { namespace detail
template <typename It, typename F> template <typename It, typename F>
static bool call(It const& it, F f) static bool call(It const& it, F f)
{ {
return false; return true;
} }
}; };

View File

@ -33,12 +33,24 @@ namespace
int int
main() 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::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 < 4)));
BOOST_TEST((boost::fusion::all(t, boost::lambda::_1 > 0))); 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::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 == 1)));