Implement the latest proposed resolution of LWG 2756.
commitce1a0ba1a875b30661afe3520c892c5ff03e54cd
authorville <ville@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 18 Aug 2016 20:33:57 +0000 (18 20:33 +0000)
committerville <ville@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 18 Aug 2016 20:33:57 +0000 (18 20:33 +0000)
treeced23a4340f17d7cbce9d65395db42f6d9c381c8
parent85adbce1adf12e676e346188666aaa4909884d22
Implement the latest proposed resolution of LWG 2756.
* include/std/optional (Optional_base(const _Tp&))
(Optional_base(_Tp&&), using _Base::_Base): Remove.
(optional(nullopt_t)): New.
(optional(_Up&&)): Invoke base directly with in_place
rather than creating a temporary, add default template
argument, change constraints.
(optional(const optional<_Up>&)): Invoke base directly
with in_place, remove unnecessary constraints.
(optional(optional<_Up>&& __t)): Likewise.
(optional(in_place_t, _Args&&...)): New.
(optional(in_place_t, initializer_list<_Up>, _Args&&...)): Likewise.
(operator=(_Up&&)): Add default template argument, change constraints.
(operator=(const optional<_Up>&)): Put is_same first in the
constraints.
(operator=(optional<_Up>&&)): Likewise.
* testsuite/20_util/optional/assignment/5.cc: Add a test to
verify assignment from something that can't be perfect-forwarded.
* testsuite/20_util/optional/cons/value.cc: Add tests to verify
that a nested optional is disengaged when constructed
from a disengaged element type, and to verify that assignments
from an engaged element type engage the optional.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239593 138bc75d-0d04-0410-961f-82ee72b054a4
libstdc++-v3/ChangeLog
libstdc++-v3/include/std/optional
libstdc++-v3/testsuite/20_util/optional/assignment/5.cc
libstdc++-v3/testsuite/20_util/optional/cons/value.cc