sort.cpp 720 B

123456789101112131415161718192021222324252627
  1. // Copyright Aleksey Gurtovoy 2004
  2. // Copyright Eric Friedman 2002-2003
  3. //
  4. // Distributed under the Boost Software License, Version 1.0.
  5. // (See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt)
  7. //
  8. // See http://www.boost.org/libs/mpl for documentation.
  9. #include <boost/mpl/sort.hpp>
  10. #include <boost/mpl/list_c.hpp>
  11. #include <boost/mpl/equal.hpp>
  12. #include <boost/mpl/equal_to.hpp>
  13. #include <boost/mpl/aux_/test.hpp>
  14. MPL_TEST_CASE()
  15. {
  16. typedef list_c<int, 3, 4, 0, -5, 8, -1, 7>::type numbers;
  17. typedef list_c<int, -5, -1, 0, 3, 4, 7, 8>::type manual_result;
  18. typedef sort< numbers >::type result;
  19. MPL_ASSERT(( equal< result,manual_result,equal_to<_1,_2> > ));
  20. }