Make any's copy assignment operator exception-safe,
authorVille Voutilainen <ville.voutilainen@gmail.com>
Mon, 10 Oct 2016 22:08:58 +0000 (01:08 +0300)
committerVille Voutilainen <ville@gcc.gnu.org>
Mon, 10 Oct 2016 22:08:58 +0000 (01:08 +0300)
commit1725d05d199fc256844040d2900d5ee206c9d289
treec60362f3d076a1ba42ebcccf84d7b65f06bfa9e1
parent496f8eead85efa20e9b17bca6039dde2b46f08c4
Make any's copy assignment operator exception-safe,

don't copy the underlying value when any is moved,
make in_place constructors explicit.
* include/std/any (any(in_place_type_t<_ValueType>, _Args&&...)):
Make explicit.
(any(in_place_type_t<_ValueType>, initializer_list<_Up>, _Args&&...)):
Likewise.
(operator=(const any&)): Make strongly exception-safe.
(operator=(any&&)): reset() unconditionally in the case where
rhs has a value.
(operator=(_ValueType&&)): Indent the return type.
(_Manager_internal<_Tp>::_S_manage): Move in _Op_xfer, don't copy.
* testsuite/20_util/any/assign/2.cc: Adjust.
* testsuite/20_util/any/assign/exception.cc: New.
* testsuite/20_util/any/cons/2.cc: Adjust.
* testsuite/20_util/any/cons/explicit.cc: New.
* testsuite/20_util/any/misc/any_cast_neg.cc: Ajust.

From-SVN: r240951
libstdc++-v3/ChangeLog
libstdc++-v3/include/std/any
libstdc++-v3/testsuite/20_util/any/assign/2.cc
libstdc++-v3/testsuite/20_util/any/assign/exception.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/any/cons/2.cc
libstdc++-v3/testsuite/20_util/any/cons/explicit.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/any/misc/any_cast_neg.cc