]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Implement LWG 3422 for std::seed_seq
authorJonathan Wakely <jwakely@redhat.com>
Tue, 22 Jun 2021 17:05:11 +0000 (18:05 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 22 Jun 2021 19:58:25 +0000 (20:58 +0100)
commit6c63cb231e4cf99552bb7904ebe402f7adcafda4
treecaa99974afc147960eb93fb72f265f43941e2d33
parentf61e5d4d8b6d4cfa96863187fa61b8c6b057a491
libstdc++: Implement LWG 3422 for std::seed_seq

This ensures that the std::seed_seq initializer-list constructor will
not be used for list-initialization unless the initializers in the list
are integers. This allows list-initialization syntax to be used with a
pair of pointers and for that to use the appropriate constructor.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

* include/bits/random.h (seed_seq): Constrain initializer-list
constructor.
* include/bits/random.tcc (seed_seq): Add template parameter.
* testsuite/26_numerics/random/seed_seq/cons/default.cc: Check
for noexcept.
* testsuite/26_numerics/random/seed_seq/cons/initlist.cc: Check
constraints.
libstdc++-v3/include/bits/random.h
libstdc++-v3/include/bits/random.tcc
libstdc++-v3/testsuite/26_numerics/random/seed_seq/cons/default.cc
libstdc++-v3/testsuite/26_numerics/random/seed_seq/cons/initlist.cc