boost_no_cxx98_random_shuffle.ipp 638 B

1234567891011121314151617181920212223
  1. // (C) Copyright John Maddock 2017.
  2. // Use, modification and distribution are subject to the
  3. // Boost Software License, Version 1.0. (See accompanying file
  4. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. // See http://www.boost.org/libs/config for most recent version.
  6. // MACRO: BOOST_NO_CXX98_RANDOM_SHUFFLE
  7. // TITLE: std::random_shuffle
  8. // DESCRIPTION: The std lib has random_shuffle.
  9. #include <algorithm>
  10. namespace boost_no_cxx98_random_shuffle{
  11. int test()
  12. {
  13. int my_array[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
  14. std::random_shuffle(&my_array[0], &my_array[9] );
  15. return 0;
  16. }
  17. }