Implement LWG 2857, {variant,optional,any}::emplace should return the constructed...
authorVille Voutilainen <ville.voutilainen@gmail.com>
Wed, 15 Mar 2017 23:13:20 +0000 (01:13 +0200)
committerVille Voutilainen <ville@gcc.gnu.org>
Wed, 15 Mar 2017 23:13:20 +0000 (01:13 +0200)
commitdf99018275c29e891ebb41634b8a34ad7e6bcfad
treef3ea96ef5ad56196f35709d8914b3629291eb9a9
parent8b8e41e5c236b4d878f56011c4bb68dd396e5e9a
Implement LWG 2857, {variant,optional,any}::emplace should return the constructed value.

Implement LWG 2857, {variant,optional,any}::emplace should
return the constructed value.
* include/std/any (emplace(_Args&&...)): Change the return type and
return a reference to the constructed value.
(emplace(initializer_list<_Up>, _Args&&...)): Likewise.
* include/std/optional (emplace(_Args&&...)): Likewise.
(emplace(initializer_list<_Up>, _Args&&...)): Likewise.
* include/std/variant (emplace<_Tp>(_Args&&...)): Likewise.
(emplace<_Tp>(initializer_list<_Up>, _Args&&...)): Likewise.
(emplace<_Np>(_Args&&...)): Likewise.
(emplace<_Np>(initializer_list<_Up>, _Args&&...)): Likewise.
* testsuite/20_util/any/assign/emplace.cc: Add tests for
checking the return value of emplace.
* testsuite/20_util/any/misc/any_cast_neg.cc: Adjust.
* testsuite/20_util/optional/assignment/6.cc: Add tests for
checking the return value of emplace.
* testsuite/20_util/variant/run.cc: Likewise.

From-SVN: r246182
libstdc++-v3/ChangeLog
libstdc++-v3/include/std/any
libstdc++-v3/include/std/optional
libstdc++-v3/include/std/variant
libstdc++-v3/testsuite/20_util/any/assign/emplace.cc
libstdc++-v3/testsuite/20_util/any/misc/any_cast_neg.cc
libstdc++-v3/testsuite/20_util/optional/assignment/6.cc
libstdc++-v3/testsuite/20_util/variant/run.cc