Make optional conditionally trivially_{copy,move}_{constructible,assignable}
authorVille Voutilainen <ville.voutilainen@gmail.com>
Mon, 15 Jan 2018 11:32:24 +0000 (13:32 +0200)
committerVille Voutilainen <ville@gcc.gnu.org>
Mon, 15 Jan 2018 11:32:24 +0000 (13:32 +0200)
commitc89f2d24685de5663523d328814541165a0d97c3
treec070209d003e7d226cbc6a6f84721259e9368bc1
parent1759d1167a0d747c9c8578034586ed5fcdb48219
Make optional conditionally trivially_{copy,move}_{constructible,assignable}

* include/std/optional (_Optional_payload): Fix the comment in
the class head and turn into a primary and one specialization.
(_Optional_payload::_M_engaged): Strike the NSDMI.
(_Optional_payload<_Tp, false>::operator=(const _Optional_payload&)):
New.
(_Optional_payload<_Tp, false>::operator=(_Optional_payload&&)):
Likewise.
(_Optional_payload<_Tp, false>::_M_get): Likewise.
(_Optional_payload<_Tp, false>::_M_reset): Likewise.
(_Optional_base_impl): Likewise.
(_Optional_base): Turn into a primary and three specializations.
(optional(nullopt)): Change the base init.
* testsuite/20_util/optional/assignment/8.cc: New.
* testsuite/20_util/optional/cons/trivial.cc: Likewise.
* testsuite/20_util/optional/cons/value_neg.cc: Adjust.

From-SVN: r256694
libstdc++-v3/ChangeLog
libstdc++-v3/include/std/optional
libstdc++-v3/testsuite/20_util/optional/assignment/8.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/optional/cons/trivial.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/optional/cons/value_neg.cc