Skip to content
  • redi's avatar
    Add experimental::sample and experimental::shuffle from N4531 · 99e91fff
    redi authored
    The additions to <experimental/random> were added in 2015 but the new
    algorithms in <experimental/algorithm> were not. This adds them.
    
    Also define "random_device" effective target to fix testsuite failures
    on bare metal targets without std::random_device. The effective target
    currently only matches targets where _GLIBCXX_USE_RANDOM_TR1 is defined,
    which means /dev/random and /dev/urandom are usable.
    
    Backport from mainline
    2018-07-04  Jonathan Wakely  <jwakely@redhat.com>
    
    	* testsuite/25_algorithms/make_heap/complexity.cc: Require effective
    	target for std::random_device.
    	* testsuite/26_numerics/random/random_device/cons/default.cc:
    	Likewise.
    	* testsuite/experimental/algorithm/sample-2.cc: Likewise.
    	* testsuite/experimental/algorithm/shuffle.cc: Likewise.
    	* testsuite/experimental/random/randint.cc: Likewise.
    	* testsuite/lib/libstdc++.exp
    	(check_effective_target_random_device): New proc.
    
    Backport from mainline
    2018-06-26  David Edelsohn  <dje.gcc@gmail.com>
    
    	* testsuite/experimental/algorithm/sample-2.cc: Add TLS DejaGNU
    	directives.
    	* testsuite/experimental/algorithm/shuffle.cc: Likewise.
    
    Backport from mainline
    2018-06-25  Jonathan Wakely  <jwakely@redhat.com>
    
    	* include/experimental/algorithm (sample, shuffle): Add new overloads
    	using per-thread random number engine.
    	* testsuite/experimental/algorithm/sample.cc: Simpify and reduce
    	dependencies by using __gnu_test::test_container.
    	* testsuite/experimental/algorithm/sample-2.cc: New.
    	* testsuite/experimental/algorithm/shuffle.cc: New.
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-8-branch@262856 138bc75d-0d04-0410-961f-82ee72b054a4
    99e91fff