1 ////////////////////////////////////////////////////////////////////////////
2 // lazy_list2_tests.cpp
3 //
4 // more tests on list<T>
5 //
6 ////////////////////////////////////////////////////////////////////////////
7 /*=============================================================================
8     Copyright (c) 2000-2003 Brian McNamara and Yannis Smaragdakis
9     Copyright (c) 2001-2007 Joel de Guzman
10     Copyright (c) 2015 John Fletcher
11 
12     Distributed under the Boost Software License, Version 1.0. (See accompanying
13     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
14 ==============================================================================*/
15 
16 #include <boost/phoenix/core/limits.hpp>
17 
18 #include <boost/detail/lightweight_test.hpp>
19 #include <boost/phoenix/core.hpp>
20 #include <boost/phoenix/function/lazy_prelude.hpp>
21 
22 
main()23 int main()
24 {
25     namespace phx = boost::phoenix;
26     using boost::phoenix::arg_names::arg1;
27     using boost::phoenix::arg_names::arg2;
28     using namespace phx;
29 
30     list<int> l0;
31     list<int> l1 = list_with<>()(1,2,3,4,5);
32     list<int> l2 = all_but_last(l1)();
33 
34     BOOST_TEST(null(l0)());
35     BOOST_TEST(head(l1)()       == 1);
36     BOOST_TEST(head(tail(l1))() == 2);
37     BOOST_TEST(last(l1)()       == 5);
38     BOOST_TEST(last(l2)()       == 4);
39     BOOST_TEST(head(drop(2,l2))() == 3);
40 
41     return boost::report_errors();
42 }
43