This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] Move stl_uninitialized.h extensions to <ext/memory>
- From: Paolo Carlini <pcarlini at unitus dot it>
- To: libstdc++ at gcc dot gnu dot org
- Cc: Paolo Carlini <pcarlini at unitus dot it>, gdr at codesourcery dot com
- Date: Sat, 29 Dec 2001 19:57:00 +0100
- Subject: Re: [PATCH] Move stl_uninitialized.h extensions to <ext/memory>
- References: <3C2E0F99.C95FD6C6@unitus.it>
Sorry,
the final hunk (for stl_deque.h) which I'd rather prefer is the following (no using
declarations).
Cheers,
Paolo.
//////////////////
diff -prN libstdc++-v3-orig/include/bits/stl_deque.h
libstdc++-v3/include/bits/stl_deque.h
*** libstdc++-v3-orig/include/bits/stl_deque.h Thu Dec 6 21:29:31 2001
--- libstdc++-v3/include/bits/stl_deque.h Sat Dec 29 19:51:29 2001
***************
*** 99,106 ****
* template template parameters), and it has been removed.
*/
namespace std
! {
// Note: this function is simply a kludge to work around several compilers'
// bugs in handling constant expressions.
inline size_t
--- 99,110 ----
* template template parameters), and it has been removed.
*/
+ #include <ext/memory> // For __uninitialized_copy_copy,
+ // __uninitialized_copy_fill,
+ // __uninitialized_fill_copy
+
namespace std
! {
// Note: this function is simply a kludge to work around several compilers'
// bugs in handling constant expressions.
inline size_t
*************** void deque<_Tp,_Alloc>::_M_insert_aux(it
*** 1223,1230 ****
fill(__pos - difference_type(__n), __pos, __x_copy);
}
else {
! __uninitialized_copy_fill(_M_start, __pos, __new_start,
! _M_start, __x_copy);
_M_start = __new_start;
fill(__old_start, __pos, __x_copy);
}
--- 1227,1234 ----
fill(__pos - difference_type(__n), __pos, __x_copy);
}
else {
! __gnu_cxx::__uninitialized_copy_fill(_M_start, __pos, __new_start,
! _M_start, __x_copy);
_M_start = __new_start;
fill(__old_start, __pos, __x_copy);
}
*************** void deque<_Tp,_Alloc>::_M_insert_aux(it
*** 1250,1257 ****
fill(__pos, __pos + difference_type(__n), __x_copy);
}
else {
! __uninitialized_fill_copy(_M_finish, __pos + difference_type(__n),
! __x_copy, __pos, _M_finish);
_M_finish = __new_finish;
fill(__pos, __old_finish, __x_copy);
}
--- 1254,1262 ----
fill(__pos, __pos + difference_type(__n), __x_copy);
}
else {
! __gnu_cxx::__uninitialized_fill_copy(_M_finish,
! __pos + difference_type(__n),
! __x_copy, __pos, _M_finish);
_M_finish = __new_finish;
fill(__pos, __old_finish, __x_copy);
}
*************** void deque<_Tp,_Alloc>::_M_insert_aux(it
*** 1287,1294 ****
else {
_ForwardIterator __mid = __first;
advance(__mid, difference_type(__n) - __elemsbefore);
! __uninitialized_copy_copy(_M_start, __pos, __first, __mid,
! __new_start);
_M_start = __new_start;
copy(__mid, __last, __old_start);
}
--- 1292,1299 ----
else {
_ForwardIterator __mid = __first;
advance(__mid, difference_type(__n) - __elemsbefore);
! __gnu_cxx::__uninitialized_copy_copy(_M_start, __pos, __first, __mid,
! __new_start);
_M_start = __new_start;
copy(__mid, __last, __old_start);
}
*************** void deque<_Tp,_Alloc>::_M_insert_aux(it
*** 1316,1322 ****
else {
_ForwardIterator __mid = __first;
advance(__mid, __elemsafter);
! __uninitialized_copy_copy(__mid, __last, __pos, _M_finish, _M_finish);
_M_finish = __new_finish;
copy(__first, __mid, __pos);
}
--- 1321,1328 ----
else {
_ForwardIterator __mid = __first;
advance(__mid, __elemsafter);
! __gnu_cxx::__uninitialized_copy_copy(__mid, __last, __pos,
! _M_finish, _M_finish);
_M_finish = __new_finish;
copy(__first, __mid, __pos);
}