Added pop_back test for lists

[SVN r73642]
This commit is contained in:
Joel de Guzman
2011-08-10 22:01:37 +00:00
parent 491b6fb7d8
commit 21c17fda63

View File

@ -1,15 +1,17 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2001-2006 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/ ==============================================================================*/
#include <boost/detail/lightweight_test.hpp> #include <boost/detail/lightweight_test.hpp>
#include <boost/fusion/container/vector/vector.hpp> #include <boost/fusion/container/vector/vector.hpp>
#include <boost/fusion/container/list/list.hpp>
#include <boost/fusion/adapted/mpl.hpp> #include <boost/fusion/adapted/mpl.hpp>
#include <boost/fusion/sequence/io/out.hpp> #include <boost/fusion/sequence/io/out.hpp>
#include <boost/fusion/sequence/comparison/equal_to.hpp> #include <boost/fusion/sequence/comparison/equal_to.hpp>
#include <boost/fusion/container/generation/make_vector.hpp> #include <boost/fusion/container/generation/make_vector.hpp>
#include <boost/fusion/container/generation/make_list.hpp>
#include <boost/fusion/algorithm/transformation/pop_back.hpp> #include <boost/fusion/algorithm/transformation/pop_back.hpp>
#include <boost/mpl/vector_c.hpp> #include <boost/mpl/vector_c.hpp>
@ -41,6 +43,12 @@ main()
BOOST_TEST((boost::fusion::pop_back(mpl_vec()) == make_vector(1, 2, 3, 4))); BOOST_TEST((boost::fusion::pop_back(mpl_vec()) == make_vector(1, 2, 3, 4)));
} }
{
list<int, int> l(1, 2);
std::cout << pop_back(l) << std::endl;
BOOST_TEST((pop_back(l) == make_list(1)));
}
return boost::report_errors(); return boost::report_errors();
} }