zip_view.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright Aleksey Gurtovoy 2002-2010
  2. //
  3. // Distributed under the Boost Software License, Version 1.0.
  4. // (See accompanying file LICENSE_1_0.txt or copy at
  5. // http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. // See http://www.boost.org/libs/mpl for documentation.
  8. // $Id$
  9. // $Date$
  10. // $Revision$
  11. #include <boost/mpl/zip_view.hpp>
  12. #include <boost/mpl/transform_view.hpp>
  13. #include <boost/mpl/filter_view.hpp>
  14. #include <boost/mpl/range_c.hpp>
  15. #include <boost/mpl/vector.hpp>
  16. #include <boost/mpl/at.hpp>
  17. #include <boost/mpl/equal.hpp>
  18. #include <boost/mpl/equal_to.hpp>
  19. #include <boost/mpl/unpack_args.hpp>
  20. #include <boost/mpl/math/is_even.hpp>
  21. #include <boost/mpl/aux_/test.hpp>
  22. #include <boost/type_traits/is_same.hpp>
  23. MPL_TEST_CASE()
  24. {
  25. typedef transform_view<
  26. zip_view< vector< range_c<int,0,10>, range_c<int,10,20> > >
  27. , unpack_args< plus<> >
  28. > result;
  29. MPL_ASSERT(( equal<
  30. result
  31. , filter_view< range_c<int,10,30>, is_even<_> >
  32. , equal_to<_,_>
  33. > ));
  34. MPL_ASSERT(( boost::is_same< zip_view<vector<> >, zip_view<vector<> >::type > ));
  35. }