erase_range.cpp 880 B

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright Aleksey Gurtovoy 2000-2004
  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/erase.hpp>
  12. #include <boost/mpl/list.hpp>
  13. #include <boost/mpl/find.hpp>
  14. #include <boost/mpl/size.hpp>
  15. #include <boost/mpl/begin_end.hpp>
  16. #include <boost/mpl/aux_/test.hpp>
  17. MPL_TEST_CASE()
  18. {
  19. typedef list<int,char,long,short,unsigned,long,double,long> types;
  20. typedef find<types,short>::type iter1;
  21. typedef find<types,double>::type iter2;
  22. typedef erase<types,iter1,iter2>::type result;
  23. MPL_ASSERT_RELATION( size<result>::value, ==, 5 );
  24. typedef find<result,unsigned>::type iter;
  25. MPL_ASSERT(( is_same< iter, end<result>::type > ));
  26. }