You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by el...@apache.org on 2008/07/23 19:16:03 UTC
svn commit: r679133 - in /stdcxx/branches/4.3.x: include/deque
include/deque.cc include/vector include/vector.cc
tests/localization/22.locale.synopsis.cpp
Author: elemings
Date: Wed Jul 23 10:16:03 2008
New Revision: 679133
URL: http://svn.apache.org/viewvc?rev=679133&view=rev
Log:
2008-07-23 Eric Lemings <er...@roguewave.com>
STDCXX-978
* include/deque: Remove function declarations that were guarded
by `#ifdef _RWSTD_NO_MEMBER_TEMPLATES' directive.
* include/vector: Same.
* inclue/deque.cc: Replace all `__self' pointers with `this'.
* include/vector.cc: Same.
* tests/localization/22.locale.synopsis.cpp: Remove unused
member functions what were guarded by same directive.
Modified:
stdcxx/branches/4.3.x/include/deque
stdcxx/branches/4.3.x/include/deque.cc
stdcxx/branches/4.3.x/include/vector
stdcxx/branches/4.3.x/include/vector.cc
stdcxx/branches/4.3.x/tests/localization/22.locale.synopsis.cpp
Modified: stdcxx/branches/4.3.x/include/deque
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/deque?rev=679133&r1=679132&r2=679133&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/include/deque (original)
+++ stdcxx/branches/4.3.x/include/deque Wed Jul 23 10:16:03 2008
@@ -58,29 +58,6 @@
template <class _TypeT, class _Allocator = allocator<_TypeT> >
class deque;
-// declarations of non-member function templates implementing
-// the functionality of deque member function templates
-
-_EXPORT
-template <class _TypeT, class _Allocator, class _InputIter>
-void __rw_assign_range (deque<_TypeT, _Allocator>*,
- _InputIter, _InputIter, input_iterator_tag);
-
-_EXPORT
-template <class _TypeT, class _Allocator, class _FwdIter>
-void __rw_assign_range (deque<_TypeT, _Allocator>*,
- _FwdIter, _FwdIter, forward_iterator_tag);
-
-_EXPORT
-template <class _TypeT, class _Allocator, class _DequeIter, class _InputIter>
-void __rw_insert_range (deque<_TypeT, _Allocator>*, _DequeIter,
- _InputIter, _InputIter, input_iterator_tag);
-
-_EXPORT
-template <class _TypeT, class _Allocator, class _DequeIter, class _BidirIter>
-void __rw_insert_range (deque<_TypeT, _Allocator>*, _DequeIter,
- _BidirIter, _BidirIter, bidirectional_iterator_tag);
-
template <class _TypeT, class _DiffT, class _Pointer,
class _Reference, class _Allocator>
Modified: stdcxx/branches/4.3.x/include/deque.cc
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/deque.cc?rev=679133&r1=679132&r2=679133&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/include/deque.cc (original)
+++ stdcxx/branches/4.3.x/include/deque.cc Wed Jul 23 10:16:03 2008
@@ -525,10 +525,8 @@
{
typedef deque _Deque;
- deque* const __self = this;
-
_RWSTD_ASSERT_RANGE (__first, __last);
- _RWSTD_ASSERT (__self->_C_is_valid ());
+ _RWSTD_ASSERT (this->_C_is_valid ());
#ifndef _RWSTD_NO_EXT_DEQUE_ASSIGN_IN_PLACE
@@ -541,21 +539,21 @@
// assignment operator and iterator operations do not throw
// -- basic otherwise
- const iterator __end = __self->end ();
+ const iterator __end = this->end ();
// avoid using the name __i or __it below so as not to trigger
// a (bogus) gcc 2.95.2 -Wshadow warning: declaration of `__i'
// shadows previous local
- for (iterator __ix = __self->begin (); !(__ix == __end);
+ for (iterator __ix = this->begin (); !(__ix == __end);
++__ix, ++__first) {
if (__first == __last) {
- __self->erase (__ix, __end);
+ this->erase (__ix, __end);
return;
}
*__ix = *__first;
}
- __self->insert (__end, __first, __last);
+ this->insert (__end, __first, __last);
#else // if defined (_RWSTD_NO_EXT_DEQUE_ASSIGN_IN_PLACE)
@@ -564,8 +562,8 @@
// complexity: linear in distance(first, last)
// exception safety: basic
- __self->clear ();
- __self->insert (__self->begin (), __first, __last);
+ this->clear ();
+ this->insert (this->begin (), __first, __last);
#endif // _RWSTD_NO_EXT_DEQUE_ASSIGN_IN_PLACE
@@ -581,9 +579,7 @@
{
typedef deque _Deque;
- _Deque* const __self = this;
-
- _RWSTD_ASSERT_RANGE (__it, __self->end ());
+ _RWSTD_ASSERT_RANGE (__it, this->end ());
_RWSTD_ASSERT_RANGE (__first, __last);
#ifndef _RWSTD_NO_EXT_DEQUE_INSERT_IN_PLACE
@@ -592,21 +588,21 @@
// from the input sequence in the case of an exception
for ( ; !(__first == __last); ++__it, ++__first)
- __it = __self->insert (__it, *__first);
+ __it = this->insert (__it, *__first);
#else // if defined (_RWSTD_NO_EXT_DEQUE_INSERT_IN_PLACE)
// 23.2.1.3, p2: if an exception is thrown other than by the copy
// constructor or assignment operator of T there are no effects.
- _Deque __tmp (__self->begin (), __it, __self->get_allocator ());
+ _Deque __tmp (this->begin (), __it, this->get_allocator ());
for (; !(__first == __last); ++__first)
__tmp.push_back (*__first);
- __tmp.insert (__tmp.end (), __it, __self->end ());
+ __tmp.insert (__tmp.end (), __it, this->end ());
- __self->swap (__tmp);
+ this->swap (__tmp);
#endif // _RWSTD_NO_EXT_DEQUE_INSERT_IN_PLACE
@@ -622,8 +618,6 @@
// {
// typedef deque _Deque;
-// _Deque* const __self = this;
-
// // implemented in terms of the Input Iterator overload
// _RWSTD_INSERT_RANGE (__it, __first, __last, input_iterator_tag ());
// }
@@ -638,17 +632,15 @@
{
typedef deque _Deque;
- _Deque* const __self = this;
-
- _RWSTD_ASSERT_RANGE (__self->begin (), __it);
+ _RWSTD_ASSERT_RANGE (this->begin (), __it);
_RWSTD_ASSERT_RANGE (__first, __last);
- _RWSTD_ASSERT (__self->_C_is_valid ());
+ _RWSTD_ASSERT (this->_C_is_valid ());
// compute the distance of `it' from the beginning of the container,
// the distance of `it' to the end of the container, and the number
// of elements to be inserted
- const size_type __sz0 = __self->size ();
- const size_type __inx = _DISTANCE (__self->begin (), __it, size_type);
+ const size_type __sz0 = this->size ();
+ const size_type __inx = _DISTANCE (this->begin (), __it, size_type);
const size_type __rem = __sz0 - __inx;
const size_type __n = _DISTANCE (__first, __last, size_type);
@@ -671,12 +663,12 @@
const _BidirIter __mid (__from);
while (!(__from == __first))
- __self->push_front (*--__from);
+ this->push_front (*--__from);
for (size_type __i = __inx; __i; --__i)
- __self->push_front (*(__self->begin () + (__n - 1)));
+ this->push_front (*(this->begin () + (__n - 1)));
- _STD::copy (__mid, __last, __self->begin () + __n);
+ _STD::copy (__mid, __last, this->begin () + __n);
}
else {
@@ -685,12 +677,12 @@
// of elements in the range [begin, it)
for (size_type __i = __n; __i; --__i)
- __self->push_front (*(__self->begin () + (__n - 1)));
+ this->push_front (*(this->begin () + (__n - 1)));
- const iterator __to = __self->begin () + __n;
+ const iterator __to = this->begin () + __n;
_STD::copy (__to + __n, __to + __inx, __to);
- _STD::copy (__first, __last, __self->begin () + __inx);
+ _STD::copy (__first, __last, this->begin () + __inx);
}
}
else {
@@ -705,20 +697,20 @@
const _BidirIter __to (__from);
for ( ; !(__from == __last); ++__from)
- __self->push_back (*__from);
+ this->push_back (*__from);
for (size_type __i = 0; __i != __rem; ++__i)
- __self->push_back (*(__self->begin () + (__inx + __i)));
+ this->push_back (*(this->begin () + (__inx + __i)));
- _STD::copy (__first, __to, __self->begin () + __inx);
+ _STD::copy (__first, __to, this->begin () + __inx);
}
else {
for (size_type __i = 0; __i != __n; ++__i)
- __self->push_back (*(__self->begin () + (__sz0 - __n + __i)));
+ this->push_back (*(this->begin () + (__sz0 - __n + __i)));
- const iterator __to = __self->begin () + __sz0;
- const iterator __from = __self->begin () + __inx;
- const iterator __from_end = __self->begin () + (__sz0 - __n);
+ const iterator __to = this->begin () + __sz0;
+ const iterator __from = this->begin () + __inx;
+ const iterator __from_end = this->begin () + (__sz0 - __n);
_STD::copy_backward (__from, __from_end, __to);
_STD::copy (__first, __last, __from);
Modified: stdcxx/branches/4.3.x/include/vector
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/vector?rev=679133&r1=679132&r2=679133&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/include/vector (original)
+++ stdcxx/branches/4.3.x/include/vector Wed Jul 23 10:16:03 2008
@@ -58,29 +58,6 @@
template <class _TypeT, class _Allocator = allocator<_TypeT> >
class vector;
-// declarations of non-member function templates implementing
-// the functionality of vector member function templates
-
-_EXPORT
-template <class _TypeT, class _Allocator, class _InputIter>
-void __rw_assign_range (vector<_TypeT, _Allocator>*,
- _InputIter, _InputIter, input_iterator_tag);
-
-_EXPORT
-template <class _TypeT, class _Allocator, class _FwdIter>
-void __rw_assign_range (vector<_TypeT, _Allocator>*,
- _FwdIter, _FwdIter, forward_iterator_tag);
-
-_EXPORT
-template <class _TypeT, class _Allocator, class _VectorIter, class _InputIter>
-void __rw_insert_range (vector<_TypeT, _Allocator>*, _VectorIter,
- _InputIter, _InputIter, input_iterator_tag);
-
-_EXPORT
-template <class _TypeT, class _Allocator, class _VectorIter, class _FwdIter>
-void __rw_insert_range (vector<_TypeT, _Allocator>*, _VectorIter,
- _FwdIter, _FwdIter, forward_iterator_tag);
-
_EXPORT
template <class _TypeT, class _Allocator>
Modified: stdcxx/branches/4.3.x/include/vector.cc
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/vector.cc?rev=679133&r1=679132&r2=679133&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/include/vector.cc (original)
+++ stdcxx/branches/4.3.x/include/vector.cc Wed Jul 23 10:16:03 2008
@@ -323,8 +323,6 @@
void vector<_TypeT, _Allocator>::
_C_assign_range (_InputIter __first, _InputIter __last, input_iterator_tag)
{
- vector* const __self = this;
-
_RWSTD_ASSERT_RANGE (__first, __last);
#ifndef _RWSTD_NO_EXT_VECTOR_ASSIGN_IN_PLACE
@@ -343,17 +341,17 @@
// assignment operator and iterator operations do not throw
// -- basic otherwise
- const iterator __end = __self->end ();
+ const iterator __end = this->end ();
- for (iterator __it = __self->begin (); __it != __end; ++__it, ++__first) {
+ for (iterator __it = this->begin (); __it != __end; ++__it, ++__first) {
if (__first == __last) {
- __self->erase (__it, __end);
+ this->erase (__it, __end);
return;
}
*__it = *__first;
}
- __self->insert (__end, __first, __last);
+ this->insert (__end, __first, __last);
#else // if defined (_RWSTD_NO_EXT_VECTOR_ASSIGN_IN_PLACE)
@@ -363,8 +361,8 @@
// exactly distance(first, last) calls to value_type's copy ctor
// exception safety: basic
- __self->clear ();
- __self->insert (__self->begin (), __first, __last);
+ this->clear ();
+ this->insert (this->begin (), __first, __last);
#endif // _RWSTD_NO_EXT_VECTOR_ASSIGN_IN_PLACE
@@ -376,8 +374,6 @@
void vector<_TypeT, _Allocator>::
_C_assign_range (_FwdIter __first, _FwdIter __last, forward_iterator_tag)
{
- vector* const __self = this;
-
_RWSTD_ASSERT_RANGE (__first, __last);
#ifndef _RWSTD_NO_EXT_VECTOR_ASSIGN_IN_PLACE
@@ -393,13 +389,13 @@
// -- basic otherwise
const size_type __size1 = _DISTANCE (__first, __last, size_type);
- const size_type __size2 = __self->size () + __size1;
+ const size_type __size2 = this->size () + __size1;
- if (__self->capacity () < __size2) {
+ if (this->capacity () < __size2) {
// exception safety: strong
- vector<value_type, allocator_type> __tmp (__self->get_allocator ());
+ vector<value_type, allocator_type> __tmp (this->get_allocator ());
__tmp.reserve (__size2);
// copy elements in the range [first, last) into the temporary
@@ -412,22 +408,22 @@
__tmp._C_push_back (*__first);
// swap *this with the temporary, having its dtor clean up
- __self->swap (__tmp);
+ this->swap (__tmp);
}
else {
// exception safety: nothrow or basic
- const iterator __end = __self->end ();
+ const iterator __end = this->end ();
- for (iterator __i = __self->begin (); __i != __end; ++__i, ++__first) {
+ for (iterator __i = this->begin (); __i != __end; ++__i, ++__first) {
if (__first == __last) {
- __self->erase (__i, __end);
+ this->erase (__i, __end);
return;
}
*__i = *__first;
}
- __self->insert (__end, __first, __last);
+ this->insert (__end, __first, __last);
}
#else // if defined (_RWSTD_NO_EXT_VECTOR_ASSIGN_IN_PLACE)
@@ -437,8 +433,8 @@
// complexity: linear in distance(first, last)
// exception safety: basic
- __self->clear ();
- __self->insert (__self->begin (), __first, __last);
+ this->clear ();
+ this->insert (this->begin (), __first, __last);
#endif // _RWSTD_NO_EXT_VECTOR_ASSIGN_IN_PLACE
@@ -451,8 +447,6 @@
_C_insert_range (iterator __it, _InputIter __first, _InputIter __last,
input_iterator_tag)
{
- vector* const __self = this;
-
_RWSTD_ASSERT_RANGE (__it, end ());
_RWSTD_ASSERT_RANGE (__first, __last);
@@ -467,34 +461,34 @@
// append one element at a time to prevent the loss of data
// from the input sequence in the case of an exception
- const size_type __size = __self->size ();
- const size_type __inx = _DISTANCE (__self->begin (), __it, size_type);
+ const size_type __size = this->size ();
+ const size_type __inx = _DISTANCE (this->begin (), __it, size_type);
_RWSTD_ASSERT (__inx <= __size);
for (; !(__first == __last); ++__first)
- __self->push_back (*__first);
+ this->push_back (*__first);
if (__inx < __size) {
// swap the inserted elements with the elements before which
// they should be inserted, as if by calling
// std::rotate (__beg, __mid, _C_end)
- const pointer __beg = __self->_C_begin + __inx;
- const pointer __mid = __self->_C_begin + __size;
+ const pointer __beg = this->_C_begin + __inx;
+ const pointer __mid = this->_C_begin + __size;
if (__beg < __mid) {
for (pointer __p0 = __beg, __p1 = __mid; __p0 < --__p1; ++__p0)
_STD::iter_swap (__p0, __p1);
}
- if (__mid < __self->_C_end) {
- for (pointer __p0 = __mid, __p1 = __self->_C_end;
+ if (__mid < this->_C_end) {
+ for (pointer __p0 = __mid, __p1 = this->_C_end;
__p0 < --__p1; ++__p0)
_STD::iter_swap (__p0, __p1);
}
- if (__beg < __self->_C_end) {
- for (pointer __p0 = __beg, __p1 = __self->_C_end;
+ if (__beg < this->_C_end) {
+ for (pointer __p0 = __beg, __p1 = this->_C_end;
__p0 < --__p1; ++__p0)
_STD::iter_swap (__p0, __p1);
}
@@ -515,14 +509,14 @@
// insert input range into a temporary sequence rather than into *this
// to coid modifying *this in case an exception (e.g., bad_alloc) is
// thrown
- vector<value_type, allocator_type> __tmp (__self->get_allocator ());
+ vector<value_type, allocator_type> __tmp (this->get_allocator ());
for ( ; !(__first == __last); ++__first)
__tmp.push_back (*__first);
// insert into *this using a more efficient algorithm optimized
// for BidirectionalIterator (and better)
- __self->insert (__it, __tmp.begin (), __tmp.end ());
+ this->insert (__it, __tmp.begin (), __tmp.end ());
#endif // _RWSTD_NO_EXT_VECTOR_INSERT_IN_PLACE
@@ -535,8 +529,6 @@
_C_insert_range (iterator __it, _FwdIter __first, _FwdIter __last,
forward_iterator_tag)
{
- vector* const __self = this;
-
_RWSTD_ASSERT_RANGE (__it, end ());
_RWSTD_ASSERT_RANGE (__first, __last);
@@ -544,7 +536,7 @@
// unless the new size of the container would exceed its capacity
// compute the sizes of the ranges of elements to be copied
- const size_type __size1 = _DISTANCE (__self->begin (), __it, size_type);
+ const size_type __size1 = _DISTANCE (this->begin (), __it, size_type);
const size_type __size2 = _DISTANCE (__first, __last, size_type);
if (!__size2)
@@ -552,7 +544,7 @@
#ifndef _RWSTD_NO_EXT_VECTOR_INSERT_IN_PLACE
const bool __insert_in_place =
- __self->size () + __size2 <= __self->capacity ();
+ this->size () + __size2 <= this->capacity ();
#else // if defined (_RWSTD_NO_EXT_VECTOR_INSERT_IN_PLACE)
const bool __insert_in_place = false;
#endif // _RWSTD_NO_EXT_VECTOR_INSERT_IN_PLACE
@@ -563,12 +555,12 @@
// in the sequence controlled by *this that need to be moved
// (copy contructed past the end of the end of the sequence
// or assigned over existing elements)
- const pointer __movbeg = __self->_C_begin + __size1;
+ const pointer __movbeg = this->_C_begin + __size1;
const pointer __movend = __movbeg + __size2;
- _RWSTD_ASSERT (__self->_C_make_iter (__movbeg) == __it);
+ _RWSTD_ASSERT (this->_C_make_iter (__movbeg) == __it);
- const pointer __end = __self->_C_end;
+ const pointer __end = this->_C_end;
if (__movend <= __end) {
// compute the beginning of the range of elements whose copies
@@ -579,7 +571,7 @@
// construct copies of elements that will be moved beyond
// the current end of the sequence controlled by *this
for (pointer __p = __ucpbeg; !(__p == __end); ++__p)
- __self->_C_push_back (*__p);
+ this->_C_push_back (*__p);
// over the range of elements moved above
for (pointer __q = __end; __movend < __q; ) {
@@ -591,7 +583,7 @@
// compute the length of the initial subsequence of the range
// of elements being inserted that overlaps the end of the
// sequence being inserted into
- const size_type __size2a = __self->size () - __size1;
+ const size_type __size2a = this->size () - __size1;
_FwdIter __mid = __first;
_STD::advance (__mid, __size2a);
@@ -600,7 +592,7 @@
// std::uninitialized_copy (__mid, __last, _C_end);
for (_FwdIter __m = __mid ; !(__m == __last); ++__m)
- __self->_C_push_back (*__m);
+ this->_C_push_back (*__m);
// construct copies of the range of elements [pos, end)
// past the end of the range of elements inserted above,
@@ -608,7 +600,7 @@
// std::uninitialized_copy (__movbeg, __end, _C_end);
for (pointer __p = __movbeg; !(__p == __end); ++__p)
- __self->_C_push_back (*__p);
+ this->_C_push_back (*__p);
__last = __mid;
}
@@ -620,9 +612,9 @@
// constructor or assignment operator of T there are no effects.
// create a temporary vector and reserve sufficient space
- vector<value_type, allocator_type> __tmp (__self->get_allocator ());
+ vector<value_type, allocator_type> __tmp (this->get_allocator ());
- __tmp.reserve (__self->size () + __size2);
+ __tmp.reserve (this->size () + __size2);
// avoid using the name __i or __it below so as not to trigger
// a (bogus) gcc 2.95.2 -Wshadow warning: declaration of `__i'
@@ -635,7 +627,7 @@
// iteration so that an exception thrown by the copy ctor
// will cause the destruction of all already constructed
// elements (by invoking the temporary's dtor)
- for (__ix = __self->begin (); __ix != __it; ++__ix) {
+ for (__ix = this->begin (); __ix != __it; ++__ix) {
__tmp._C_push_back (*__ix);
}
@@ -647,12 +639,12 @@
}
// copy the remaining elements from *this
- for ( ; __ix != __self->end (); ++__ix) {
+ for ( ; __ix != this->end (); ++__ix) {
__tmp._C_push_back (*__ix);
}
// swap *this with the temporary, having its dtor clean up
- __self->swap (__tmp);
+ this->swap (__tmp);
}
}
Modified: stdcxx/branches/4.3.x/tests/localization/22.locale.synopsis.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/localization/22.locale.synopsis.cpp?rev=679133&r1=679132&r2=679133&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/tests/localization/22.locale.synopsis.cpp (original)
+++ stdcxx/branches/4.3.x/tests/localization/22.locale.synopsis.cpp Wed Jul 23 10:16:03 2008
@@ -441,10 +441,6 @@
}
static std::locale::id id;
-
- virtual std::locale::id& _C_get_id () const {
- return id;
- }
};
@@ -568,11 +564,6 @@
is_dtor_virtual = true;
}
- virtual std::locale::id& _C_get_id () const {
- static std::locale::id id;
- return id;
- }
-
};
// delete a derived object using a pointer to the base