diff options
author | redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-09-09 17:29:32 +0000 |
---|---|---|
committer | redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-09-09 17:29:32 +0000 |
commit | 65d8ffc239855f020a53c9ca5309642fec98ce9a (patch) | |
tree | 55818653d7216532f7c0186498ada0fe0a1ece63 /libstdc++-v3/include/debug | |
parent | 50fc2d35060bbfe9bbce88c66197b3d6e45f057b (diff) | |
download | gcc-65d8ffc239855f020a53c9ca5309642fec98ce9a.tar.gz |
Make std::deque meet C++11 allocator requirements.
* include/bits/deque.tcc (deque::operator=(const deque&)): Handle
allocator propagation.
(deque::emplace_front, deque::emplace_back): Use allocator traits.
(deque::_M_push_back_aux, deque::_M_push_front_aux): Likewise.
(deque::_M_pop_back_aux, deque::_M_pop_front_aux): Likewise.
* include/bits/stl_deque.h (__deque_buf_size): Add constexpr.
(_Deque_iterator): Handle allocators with custom pointers.
(_Deque_base): Likewise. Use allocator traits.
(deque): Likewise. Add allocator-extended constructors.
(deque::_M_move_assign1, deque::_M_move_assign2): Implement move
assignment via tag dispatching.
(deque::_M_replace_map): Replace existing data.
* include/debug/deque (deque): Add allocator-extended constructors.
* include/profile/deque (deque): Likewise.
* testsuite/23_containers/deque/allocator/copy.cc: New.
* testsuite/23_containers/deque/allocator/copy_assign.cc: New.
* testsuite/23_containers/deque/allocator/ext_ptr.cc: New.
* testsuite/23_containers/deque/allocator/minimal.cc: New.
* testsuite/23_containers/deque/allocator/move.cc: New.
* testsuite/23_containers/deque/allocator/move_assign-2.cc: New.
* testsuite/23_containers/deque/allocator/move_assign.cc: New.
* testsuite/23_containers/deque/allocator/noexcept.cc: New.
* testsuite/23_containers/deque/allocator/swap.cc: New.
* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* testsuite/23_containers/deque/requirements/dr438/
constructor_1_neg.cc: Likewise.
* testsuite/23_containers/deque/requirements/dr438/
constructor_2_neg.cc: Likewise.
* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
Likewise.
* testsuite/23_containers/vector/52591.cc: Test both the propagating
and always-equal cases.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@215090 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/debug')
-rw-r--r-- | libstdc++-v3/include/debug/deque | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libstdc++-v3/include/debug/deque b/libstdc++-v3/include/debug/deque index 75be7489b1a..824cb289112 100644 --- a/libstdc++-v3/include/debug/deque +++ b/libstdc++-v3/include/debug/deque @@ -88,6 +88,12 @@ namespace __debug deque(const deque&) = default; deque(deque&&) = default; + deque(const deque& __d, const _Allocator& __a) + : _Base(__d, __a) { } + + deque(deque&& __d, const _Allocator& __a) + : _Safe(std::move(__d)), _Base(std::move(__d), __a) { } + deque(initializer_list<value_type> __l, const allocator_type& __a = allocator_type()) : _Base(__l, __a) { } @@ -101,8 +107,8 @@ namespace __debug #if __cplusplus >= 201103L explicit - deque(size_type __n) - : _Base(__n) { } + deque(size_type __n, const _Allocator& __a = _Allocator()) + : _Base(__n, __a) { } deque(size_type __n, const _Tp& __value, const _Allocator& __a = _Allocator()) |