Constrain swap overload for std::optional (LWG 2748)
authorJonathan Wakely <jwakely@redhat.com>
Tue, 15 Nov 2016 14:33:09 +0000 (14:33 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 15 Nov 2016 14:33:09 +0000 (14:33 +0000)
commit8b99f005cbf2fdc6968d75a13cd2c166795418b7
tree3676a43416e28a113de8057900d835998c972dbb
parentb229ab2a712ccd44126bcbcaed2da8b998e7366c
Constrain swap overload for std::optional (LWG 2748)

* doc/xml/manual/intro.xml: Document LWG 2748 status.
* include/std/optional (optional<T>::swap): Use is_nothrow_swappable_v
for exception specification.
(swap(optional<T>&, optional<T>&)): Disable when T is not swappable.
* testsuite/20_util/optional/swap/2.cc: New test.

From-SVN: r242415
libstdc++-v3/ChangeLog
libstdc++-v3/doc/xml/manual/intro.xml
libstdc++-v3/include/std/optional
libstdc++-v3/testsuite/20_util/optional/swap/2.cc [new file with mode: 0644]