diff options
author | Matt Austern <austern@apple.com> | 2004-07-28 16:37:20 +0000 |
---|---|---|
committer | Matt Austern <austern@apple.com> | 2004-07-28 16:37:20 +0000 |
commit | a751112bf94e761843f7e7c3ddeebde44f7d5e30 (patch) | |
tree | 1c1e052f56fe594ac2a2f7349bea7763b2fdca24 /libstdc++-v3/include/ext/rope | |
parent | 8b85c18d20ddde134870102c8f3539c25727038f (diff) |
* include/bits/stl_construct.h (_Destroy): New three-argument
overload that takes an allocator argument. Another inline
three-argument overload that takes std::allocator and dispatches
to the two-argument version.
* include/bits/stl_uninitialized.h (__uninitialized_fill_n_aux):
Change return type to void to match uninitialized_fill_n.
(__uninitialized_copy_a_): New function. Like uninitialized_copy
except that it takes an allocator and uses it for construct and
destroy. If the allocator is std::allocator, dispatches to
uninitialized_copy.
(__uninitialized_fill_a): Likewise.
(__uninitialized_fill_n_a): Likewise.
(__uninitialized_copy_copy): Give it an allocator argument.
(__uninitialized_fill_copy): Likewise.
(__uninitialized_copy_fill): Likewise.
* include/bits/deque.tcc: Use new forms defined in stl_construct.h
and stl_uninitialized.h. Replace use of single-argument _Construct
and _Destroy with use of allocator's construct and destroy methods.
* include/bits/list.tcc: Likewise.
* include/bits/stl_deque.h: Likewise.
* include/bits/stl_list.h: Likewise.
* include/bits/stl_tree.h: Likewise.
* include/bits/stl_vector.h: Likewise.
* include/bits/vector.tcc: Likewise.
* include/ext/hashtable.h: Use rebind so that allocator_type
has correct type for a container's allocator. Replace use of
single-argument _Construct and _Destroy with use of allocator's
construct and destroy methods.
* include/ext/memory (__uninitialized_copy_n_a): New function.
Like uninitialized_copy_n except that it takes an extra parameter,
an allocator, and uses it for construct and destroy operations.
* include/ext/rope: Use new forms defined in stl_construct.h,
stl_uninitialized.h, and ext/memory. Replace use of single-argument
_Construct and _Destroy with allocator construct and destroy methods.
* include/ext/ropeimpl.h: Likewise.
* include/ext/slist.h: Likewise.
* testsuite/testsuite_allocator.h (check_construct_destroy): New.
* testsuite/testsuite_allocator.cc (check_construct_destroy): New.
* testsuite/23_containers/deque/check_construct_destroy.cc: New.
* testsuite/23_containers/list/check_construct_destroy.cc: New.
* testsuite/23_containers/set/check_construct_destroy.cc: New.
* testsuite/23_containers/vector/check_construct_destroy.cc: New.
* testsuite/ext/hash_check_construct_destroy.cc: New.
* testsuite/ext/slist_check_construct_destroy.cc: New.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@85265 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/ext/rope')
-rw-r--r-- | libstdc++-v3/include/ext/rope | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libstdc++-v3/include/ext/rope b/libstdc++-v3/include/ext/rope index 8cfcde9534e..ff9e3bd277b 100644 --- a/libstdc++-v3/include/ext/rope +++ b/libstdc++-v3/include/ext/rope @@ -1642,7 +1642,7 @@ protected: return 0; _CharT* __buf = __a.allocate(_S_rounded_up_size(__size)); - uninitialized_copy_n(__s, __size, __buf); + __uninitialized_copy_n_a(__s, __size, __buf, __a); _S_cond_store_eos(__buf[__size]); try { return _S_new_RopeLeaf(__buf, __size, __a); } @@ -1790,7 +1790,7 @@ protected: { _CharT* __buf = this->_Data_allocate(_S_rounded_up_size(1)); - std::_Construct(__buf, __c); + get_allocator().construct(__buf, __c); try { this->_M_tree_ptr = _S_new_RopeLeaf(__buf, 1, __a); } catch(...) @@ -1905,7 +1905,7 @@ protected: void copy(_CharT* __buffer) const { - _Destroy(__buffer, __buffer + size()); + _Destroy(__buffer, __buffer + size(), get_allocator()); _S_flatten(this->_M_tree_ptr, __buffer); } @@ -1920,7 +1920,7 @@ protected: size_t __size = size(); size_t __len = (__pos + __n > __size? __size - __pos : __n); - _Destroy(__buffer, __buffer + __len); + _Destroy(__buffer, __buffer + __len, get_allocator()); _S_flatten(this->_M_tree_ptr, __pos, __len, __buffer); return __len; } |