Implement P0032R3, Homogeneous interface for variant, any and optional,
authorVille Voutilainen <ville.voutilainen@gmail.com>
Thu, 14 Jul 2016 09:10:05 +0000 (12:10 +0300)
committerVille Voutilainen <ville@gcc.gnu.org>
Thu, 14 Jul 2016 09:10:05 +0000 (12:10 +0300)
commit25a69162c99e78e9a23066f6c4465176ee4b6213
tree55dbc3ec38b350b3bd5207f535070577e1812ae0
parentc0d31471bade3deb8f1d7e3110e0d40c1555f849
Implement P0032R3, Homogeneous interface for variant, any and optional,

for the parts concerning any and optional.
* include/std/any (_Storage()): Make constexpr and have it
initialize _M_ptr.
(any()): Make constexpr.
(any(const any&)): Adjust.
(any(any&&)): Likewise.
(__any_constructible_t): New.
(any(_ValueType&&)): Constrain.
(any(in_place_type_t<_Tp>, _Args&&...)): New.
(any(in_place_type_t<_Tp>, initializer_list<_Up>, _Args&&...)):
Likewise.
(~any()): Adjust.
(operator=(const any&)): Likewise.
(operator=(any&&)): Likewise.
(operator=(_ValueType&&)): Constrain.
(emplace(_Args&&...)): New.
(emplace(initializer_list<_Up>, _Args&&...)): Likewise.
(clear()): Remove.
(reset()): New.
(swap(any&)): Adjust.
(empty()): Remove.
(has_value()): New.
(type()): Adjust.
(_Manager_internal::_S_create(_Storage&, _Args&&...)): New.
(_Manager_external::_S_create(_Storage&, _Args&&...)): Likewise.
(make_any(_Args&&...)): Likewise.
(make_any(initializer_list<_Up>, _Args&&...)): Likewise.
* include/std/optional (in_place_t, in_place): Remove.
(bad_optional_access): Add a comment referring to LEWG 72.
(emplace(_Args&&...)): Constrain.
(has_value()): New.
(reset()): Likewise.
(make_optional(_Args&&...)): Likewise.
(make_optional(initializer_list<_Up>, _Args&&...)): Likewise.
* include/std/utility (in_place_tag): New.
(__in_place, __in_place_type, __in_place_index): Likewise.
(in_place_t, in_place_type_t, in_place_index_t): Likewise.
(in_place(__in_place*)): Likewise.
(in_place(__in_place_type<_Tp>*)): Likewise.
(in_place(__in_place_index<_Idx>*)): Likewise.
* testsuite/20_util/any/assign/1.cc: Adjust.
* testsuite/20_util/any/assign/emplace.cc: New.
* testsuite/20_util/any/assign/self.cc: Adjust.
* testsuite/20_util/any/cons/1.cc: Likewise.
* testsuite/20_util/any/cons/in_place.cc: New.
* testsuite/20_util/any/make_any.cc: Likewise.
* testsuite/20_util/any/misc/any_cast_neg.cc: Adjust.
* testsuite/20_util/any/misc/swap.cc: Likewise.
* testsuite/20_util/any/modifiers/1.cc: Likewise.
* testsuite/20_util/any/requirements.cc: New.
* testsuite/20_util/in_place/requirements.cc: Likewise.
* testsuite/20_util/optional/constexpr/in_place.cc: Adjust.
* testsuite/20_util/optional/in_place.cc: Likewise.
* testsuite/20_util/optional/make_optional.cc: Add tests for
the new overloads of make_optional.

From-SVN: r238329
18 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/include/std/any
libstdc++-v3/include/std/optional
libstdc++-v3/include/std/utility
libstdc++-v3/testsuite/20_util/any/assign/1.cc
libstdc++-v3/testsuite/20_util/any/assign/emplace.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/any/assign/self.cc
libstdc++-v3/testsuite/20_util/any/cons/1.cc
libstdc++-v3/testsuite/20_util/any/cons/in_place.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/any/make_any.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/any/misc/any_cast_neg.cc
libstdc++-v3/testsuite/20_util/any/misc/swap.cc
libstdc++-v3/testsuite/20_util/any/modifiers/1.cc
libstdc++-v3/testsuite/20_util/any/requirements.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/in_place/requirements.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/optional/constexpr/in_place.cc
libstdc++-v3/testsuite/20_util/optional/in_place.cc
libstdc++-v3/testsuite/20_util/optional/make_optional.cc