Remove some more code duplication in std::optional
authorJonathan Wakely <jwakely@redhat.com>
Wed, 9 Jan 2019 10:40:49 +0000 (10:40 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 9 Jan 2019 10:40:49 +0000 (10:40 +0000)
commit50b0a3d672fba49a69056e4a70fcc318d8d4c7df
tree30f05061b35e63e38f9190b39e3f40c022ee9ee3
parent5ed895a74a12da82d2adafda7e6196de8221ddd2
Remove some more code duplication in std::optional

Hoist the duplicated code from the _Optional_payload partial
specializations into the _Optional_payload_base base class.

* include/std/optional (_Optional_payload_base::_M_copy_assign): New
member function to perform non-trivial assignment.
(_Optional_payload_base::_M_move_assign): Likewise.
(_Optional_payload<T, true, false, true>::operator=)
(_Optional_payload<T, true, true, false>::operator=)
(_Optional_payload<T, true, false, false>::operator=): Call
_M_copy_assign and/or _M_move_assign to do non-trivial assignments.

From-SVN: r267761
libstdc++-v3/ChangeLog
libstdc++-v3/include/std/optional