diff options
author | redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-11-05 21:10:27 +0000 |
---|---|---|
committer | redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-11-05 21:10:27 +0000 |
commit | b41dd924b7c5590e4e2089fa6733c70522f505df (patch) | |
tree | 553f439a5157ae50ed27353875aa3cac4fd0c23b /libstdc++-v3/include/profile | |
parent | 6a2dcb1ff09cc7cdb473d4f864413da155ef480c (diff) | |
download | gcc-b41dd924b7c5590e4e2089fa6733c70522f505df.tar.gz |
* include/profile/forward_list: Update to meet allocator-aware
requirements.
* include/debug/forward_list: Likewise.
* include/debug/vector: Verify allocators are swapped or equal.
* include/debug/macros.h (__glibcxx_check_equal_allocs): Define.
* include/debug/formatter.h: Add new debug message.
* src/c++11/debug.cc: Likewise.
* testsuite/23_containers/forward_list/allocator/swap.cc: Do not
swap containers with non-propagating, non-equal allocators.
* testsuite/23_containers/vector/allocator/swap.cc: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193186 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/profile')
-rw-r--r-- | libstdc++-v3/include/profile/forward_list | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/libstdc++-v3/include/profile/forward_list b/libstdc++-v3/include/profile/forward_list index 618b2480caa..a44ea7aeeb4 100644 --- a/libstdc++-v3/include/profile/forward_list +++ b/libstdc++-v3/include/profile/forward_list @@ -1,6 +1,6 @@ // <forward_list> -*- C++ -*- -// Copyright (C) 2010, 2011 Free Software Foundation, Inc. +// Copyright (C) 2010-2012 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -46,10 +46,14 @@ namespace __profile { typedef _GLIBCXX_STD_C::forward_list<_Tp, _Alloc> _Base; + typedef typename __gnu_cxx::__alloc_traits<_Alloc>::template + rebind<_GLIBCXX_STD_C::_Fwd_list_node<_Tp>>::other _Node_alloc_type; + + typedef __gnu_cxx::__alloc_traits<_Node_alloc_type> _Node_alloc_traits; + public: typedef typename _Base::size_type size_type; - public: // 23.2.3.1 construct/copy/destroy: explicit forward_list(const _Alloc& __al = _Alloc()) @@ -64,8 +68,8 @@ namespace __profile { } explicit - forward_list(size_type __n) - : _Base(__n) + forward_list(size_type __n, const _Alloc& __al = _Alloc()) + : _Base(__n, __al) { } forward_list(size_type __n, const _Tp& __value, @@ -103,11 +107,9 @@ namespace __profile forward_list& operator=(forward_list&& __list) + noexcept(_Node_alloc_traits::_S_nothrow_move()) { - // NB: DR 1204. - // NB: DR 675. - _Base::clear(); - _Base::swap(__list); + static_cast<_Base&>(*this) = std::move(__list); return *this; } |