Constrain constructors and member functions of random number engines so that functions taking seed sequences can only be called with types that meet the seed sequence requirements. PR libstdc++/85749 * include/bits/random.h (__detail::__is_seed_seq): New SFINAE helper. (linear_congruential_engine, mersenne_twister_engine) (subtract_with_carry_engine, discard_block_engine) (independent_bits_engine, shuffle_order_engine): Use __is_seed_seq to constrain function templates taking seed sequences. * include/bits/random.tcc (linear_congruential_engine::seed(_Sseq&)) (mersenne_twister_engine::seed(_Sseq&)) (subtract_with_carry_engine::seed(_Sseq&)): Change return types to match declarations. * include/ext/random (simd_fast_mersenne_twister_engine): Use __is_seed_seq to constrain function templates taking seed sequences. * include/ext/random.tcc (simd_fast_mersenne_twister_engine::seed): Change return type to match declaration. * testsuite/26_numerics/random/discard_block_engine/cons/seed_seq2.cc: New. * testsuite/26_numerics/random/independent_bits_engine/cons/ seed_seq2.cc: New. * testsuite/26_numerics/random/linear_congruential_engine/cons/ seed_seq2.cc: New. * testsuite/26_numerics/random/mersenne_twister_engine/cons/ seed_seq2.cc: New. * testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-error lineno. * testsuite/26_numerics/random/shuffle_order_engine/cons/seed_seq2.cc: New. * testsuite/26_numerics/random/subtract_with_carry_engine/cons/ seed_seq2.cc: New. * testsuite/ext/random/simd_fast_mersenne_twister_engine/cons/ seed_seq2.cc: New. From-SVN: r260263
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
array_allocator | Loading commit data... | |
bitmap_allocator | Loading commit data... | |
codecvt | Loading commit data... | |
concurrence_lock_error | Loading commit data... | |
concurrence_unlock_error | Loading commit data... | |
debug_allocator | Loading commit data... | |
enc_filebuf | Loading commit data... | |
ext_pointer | Loading commit data... | |
forced_error | Loading commit data... | |
iota | Loading commit data... | |
is_heap | Loading commit data... | |
is_sorted | Loading commit data... | |
malloc_allocator | Loading commit data... | |
mt_allocator | Loading commit data... | |
new_allocator | Loading commit data... | |
numeric_traits | Loading commit data... | |
pb_ds | Loading commit data... | |
pool_allocator | Loading commit data... | |
profile | Loading commit data... | |
random | Loading commit data... | |
rope | Loading commit data... | |
shared_ptr | Loading commit data... | |
slist | Loading commit data... | |
special_functions | Loading commit data... | |
stdio_filebuf | Loading commit data... | |
stdio_sync_filebuf | Loading commit data... | |
throw_allocator | Loading commit data... | |
throw_value | Loading commit data... | |
type_traits | Loading commit data... | |
vstring | Loading commit data... | |
concept_checks.cc | Loading commit data... | |
headers.cc | Loading commit data... | |
median.cc | Loading commit data... | |
pod_char_traits.cc | Loading commit data... |