Implement LWG 2842, in_place_t check for optional::optional(U&&) should decay U.
authorVille Voutilainen <ville.voutilainen@gmail.com>
Thu, 29 Dec 2016 19:19:59 +0000 (21:19 +0200)
committerVille Voutilainen <ville@gcc.gnu.org>
Thu, 29 Dec 2016 19:19:59 +0000 (21:19 +0200)
commit2ae2d394c1f9928fcb4bb7efdf9874edb787936a
tree5f999260165757bb14be4c311ec15e229091ee47
parentf3d17b5e71df5bae6d5fe34319058473aa6678d4
Implement LWG 2842, in_place_t check for optional::optional(U&&) should decay U.

Implement LWG 2842, in_place_t check for optional::optional(U&&)
should decay U.
* include/std/optional (_Optional_base(in_place_t, _Args&&...)):
Constrain.
(_Optional_base(in_place_t, initializer_list<_Up>, _Args&&...)):
Turn the int-pack constraint hack into a saner bool.
(_Optional_base<_Tp, false>::_Optional_base(in_place_t, _Args&&...)):
Constrain.
(_Optional_base<_Tp, false>::_Optional_base(in_place_t,
initializer_list<_Up>, _Args&&...)):
Turn the int-pack constraint hack into a saner bool.
(optional(_Up&&)): Constrain against in_place_t.
(optional(in_place_t, _Args&&...)): Constrain.
(constexpr optional(in_place_t, initializer_list<_Up>, _Args&&...)):
Turn the int-pack constraint hack into a saner bool.
* testsuite/20_util/optional/cons/value_neg.cc: Add a test for
a type that is constructible from in_place.

From-SVN: r243966
libstdc++-v3/ChangeLog
libstdc++-v3/include/std/optional
libstdc++-v3/testsuite/20_util/optional/cons/value_neg.cc