insert.cpp 830 B

12345678910111213141516171819202122232425262728293031
  1. // Copyright Aleksey Gurtovoy 2001-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/insert.hpp>
  12. #include <boost/mpl/find.hpp>
  13. #include <boost/mpl/vector_c.hpp>
  14. #include <boost/mpl/size.hpp>
  15. #include <boost/mpl/range_c.hpp>
  16. #include <boost/mpl/equal.hpp>
  17. #include <boost/mpl/aux_/test.hpp>
  18. MPL_TEST_CASE()
  19. {
  20. typedef vector_c<int,0,1,3,4,5,6,7,8,9> numbers;
  21. typedef find< numbers,integral_c<int,3> >::type pos;
  22. typedef insert< numbers,pos,integral_c<int,2> >::type range;
  23. MPL_ASSERT_RELATION( size<range>::value, ==, 10 );
  24. MPL_ASSERT(( equal< range,range_c<int,0,10> > ));
  25. }