]> git.ipfire.org Git - thirdparty/gcc.git/commit - libstdc++-v3/testsuite/20_util/unique_ptr/dr2899.cc
LWG 2899 - Make is_move_constructible correct for unique_ptr
authorJonathan Wakely <jwakely@redhat.com>
Tue, 14 May 2019 11:17:11 +0000 (12:17 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 14 May 2019 11:17:11 +0000 (12:17 +0100)
commit1b18663e0fbd6e253feca9e1f29e6f5b5538408d
treebe2e6b69d0fe35d1b66e9bb20d0403e15e5daa86
parent24c30e14105435d100aee4a5a832e09cab1be6e1
LWG 2899 - Make is_move_constructible correct for unique_ptr

* include/bits/unique_ptr.h (__uniq_ptr_impl): Add move constructor,
move assignment operator.
(__uniq_ptr_impl::release(), __uniq_ptr_impl::reset(pointer)): Add.
(__uniq_ptr_data): New class template with conditionally deleted
special members.
(unique_ptr, unique_ptr<T[], D>): Change type of data member from
__uniq_ptr_impl<T, D> to __uniq_ptr_data<T, D>. Define move
constructor and move assignment operator as defaulted.
(unique_ptr::release(), unique_ptr<T[], D>::release()): Forward to
__uniq_ptr_impl::release().
(unique_ptr::reset(pointer), unique_ptr<T[], D>::reset<U>(U)): Forward
to __uniq_ptr_impl::reset(pointer).
* python/libstdcxx/v6/printers.py (UniquePointerPrinter.__init__):
Check for new __uniq_ptr_data type.
* testsuite/20_util/unique_ptr/dr2899.cc: New test.

From-SVN: r271158
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/unique_ptr.h
libstdc++-v3/python/libstdcxx/v6/printers.py
libstdc++-v3/testsuite/20_util/unique_ptr/dr2899.cc [new file with mode: 0644]