This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[v3] Trivial formatting fixes to some headers


Hi,

tested x86-linux, committed to mainline.

Paolo.

///////////////
2004-07-04  Paolo Carlini  <pcarlini@suse.de>

	* include/bits/basic_string.h: Trivial formatting fixes and/or
	const-ification of some variables.
	* include/bits/deque.tcc: Likewise.
	* include/bits/stl_algobase.h: Likewise.
	* include/bits/stl_bvector.h: Likewise.
	* include/bits/stl_construct.h: Likewise.
	* include/bits/stl_deque.h: Likewise.
	* include/bits/stl_pair.h: Likewise.
	* include/bits/stl_vector.h: Likewise.
	* include/bits/vector.tcc: Likewise.
diff -urN libstdc++-v3-orig/include/bits/basic_string.h libstdc++-v3/include/bits/basic_string.h
--- libstdc++-v3-orig/include/bits/basic_string.h	2004-05-23 01:46:32.000000000 +0200
+++ libstdc++-v3/include/bits/basic_string.h	2004-07-04 19:33:04.000000000 +0200
@@ -1294,47 +1294,47 @@
       // Specializations for the common case of pointer and iterator:
       // useful to avoid the overhead of temporary buffering in _M_replace.
       basic_string&
-        replace(iterator __i1, iterator __i2, _CharT* __k1, _CharT* __k2)
-        {
-	  _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
-				   && __i2 <= _M_iend());
-	  __glibcxx_requires_valid_range(__k1, __k2);
-	  return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
-			       __k1, __k2 - __k1);
-	}
+      replace(iterator __i1, iterator __i2, _CharT* __k1, _CharT* __k2)
+      {
+	_GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+				 && __i2 <= _M_iend());
+	__glibcxx_requires_valid_range(__k1, __k2);
+	return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
+			     __k1, __k2 - __k1);
+      }
 
       basic_string&
-        replace(iterator __i1, iterator __i2,
-		const _CharT* __k1, const _CharT* __k2)
-        {
-	  _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
-				   && __i2 <= _M_iend());
-	  __glibcxx_requires_valid_range(__k1, __k2);
-	  return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
-			       __k1, __k2 - __k1);
-	}
+      replace(iterator __i1, iterator __i2,
+	      const _CharT* __k1, const _CharT* __k2)
+      {
+	_GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+				 && __i2 <= _M_iend());
+	__glibcxx_requires_valid_range(__k1, __k2);
+	return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
+			     __k1, __k2 - __k1);
+      }
 
       basic_string&
-        replace(iterator __i1, iterator __i2, iterator __k1, iterator __k2)
-        {
-	  _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
-				   && __i2 <= _M_iend());
-	  __glibcxx_requires_valid_range(__k1, __k2);
-	  return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
-			       __k1.base(), __k2 - __k1);
-	}
+      replace(iterator __i1, iterator __i2, iterator __k1, iterator __k2)
+      {
+	_GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+				 && __i2 <= _M_iend());
+	__glibcxx_requires_valid_range(__k1, __k2);
+	return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
+			     __k1.base(), __k2 - __k1);
+      }
 
       basic_string&
-        replace(iterator __i1, iterator __i2,
-		const_iterator __k1, const_iterator __k2)
-        {
-	  _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
-				   && __i2 <= _M_iend());
-	  __glibcxx_requires_valid_range(__k1, __k2);
-	  return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
-			       __k1.base(), __k2 - __k1);
-	}
-
+      replace(iterator __i1, iterator __i2,
+	      const_iterator __k1, const_iterator __k2)
+      {
+	_GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+				 && __i2 <= _M_iend());
+	__glibcxx_requires_valid_range(__k1, __k2);
+	return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
+			     __k1.base(), __k2 - __k1);
+      }
+      
     private:
       template<class _Integer>
 	basic_string&
diff -urN libstdc++-v3-orig/include/bits/deque.tcc libstdc++-v3/include/bits/deque.tcc
--- libstdc++-v3-orig/include/bits/deque.tcc	2004-04-21 16:05:59.000000000 +0200
+++ libstdc++-v3/include/bits/deque.tcc	2004-07-04 19:13:40.000000000 +0200
@@ -86,7 +86,7 @@
 
   template <typename _Tp, typename _Alloc>
     typename deque<_Tp,_Alloc>::iterator
-    deque<_Tp,_Alloc>::
+    deque<_Tp, _Alloc>::
     insert(iterator position, const value_type& __x)
     {
       if (position._M_cur == this->_M_impl._M_start._M_cur)
@@ -107,12 +107,12 @@
 
   template <typename _Tp, typename _Alloc>
     typename deque<_Tp,_Alloc>::iterator
-    deque<_Tp,_Alloc>::
+    deque<_Tp, _Alloc>::
     erase(iterator __position)
     {
       iterator __next = __position;
       ++__next;
-      size_type __index = __position - this->_M_impl._M_start;
+      const size_type __index = __position - this->_M_impl._M_start;
       if (__index < (size() >> 1))
 	{
 	  std::copy_backward(this->_M_impl._M_start, __position, __next);
@@ -128,7 +128,7 @@
 
   template <typename _Tp, typename _Alloc>
     typename deque<_Tp,_Alloc>::iterator
-    deque<_Tp,_Alloc>::
+    deque<_Tp, _Alloc>::
     erase(iterator __first, iterator __last)
     {
       if (__first == this->_M_impl._M_start
@@ -166,7 +166,7 @@
 
   template <typename _Tp, typename _Alloc>
     void
-    deque<_Tp,_Alloc>::
+    deque<_Tp, _Alloc>::
     clear()
     {
       for (_Map_pointer __node = this->_M_impl._M_start._M_node + 1;
@@ -195,12 +195,12 @@
   template <typename _Tp, class _Alloc>
     template <typename _InputIterator>
       void
-      deque<_Tp,_Alloc>
+      deque<_Tp, _Alloc>
       ::_M_assign_aux(_InputIterator __first, _InputIterator __last,
 		      input_iterator_tag)
       {
         iterator __cur = begin();
-        for ( ; __first != __last && __cur != end(); ++__cur, ++__first)
+        for (; __first != __last && __cur != end(); ++__cur, ++__first)
           *__cur = *__first;
         if (__first == __last)
           erase(__cur, end());
@@ -210,7 +210,7 @@
 
   template <typename _Tp, typename _Alloc>
     void
-    deque<_Tp,_Alloc>::
+    deque<_Tp, _Alloc>::
     _M_fill_insert(iterator __pos, size_type __n, const value_type& __x)
     {
       if (__pos._M_cur == this->_M_impl._M_start._M_cur)
@@ -250,7 +250,7 @@
 
   template <typename _Tp, typename _Alloc>
     void
-    deque<_Tp,_Alloc>::
+    deque<_Tp, _Alloc>::
     _M_fill_initialize(const value_type& __value)
     {
       _Map_pointer __cur;
@@ -274,14 +274,14 @@
   template <typename _Tp, typename _Alloc>
     template <typename _InputIterator>
       void
-      deque<_Tp,_Alloc>::
+      deque<_Tp, _Alloc>::
       _M_range_initialize(_InputIterator __first, _InputIterator __last,
                           input_iterator_tag)
       {
         this->_M_initialize_map(0);
         try
           {
-            for ( ; __first != __last; ++__first)
+            for (; __first != __last; ++__first)
               push_back(*__first);
           }
         catch(...)
@@ -294,7 +294,7 @@
   template <typename _Tp, typename _Alloc>
     template <typename _ForwardIterator>
       void
-      deque<_Tp,_Alloc>::
+      deque<_Tp, _Alloc>::
       _M_range_initialize(_ForwardIterator __first, _ForwardIterator __last,
                           forward_iterator_tag)
       {
@@ -327,7 +327,7 @@
   // Called only if _M_impl._M_finish._M_cur == _M_impl._M_finish._M_last - 1.
   template <typename _Tp, typename _Alloc>
     void
-    deque<_Tp,_Alloc>::
+    deque<_Tp, _Alloc>::
     _M_push_back_aux(const value_type& __t)
     {
       value_type __t_copy = __t;
@@ -350,7 +350,7 @@
   // Called only if _M_impl._M_start._M_cur == _M_impl._M_start._M_first.
   template <typename _Tp, typename _Alloc>
     void
-    deque<_Tp,_Alloc>::
+    deque<_Tp, _Alloc>::
     _M_push_front_aux(const value_type& __t)
     {
       value_type __t_copy = __t;
@@ -373,7 +373,7 @@
 
   // Called only if _M_impl._M_finish._M_cur == _M_impl._M_finish._M_first.
   template <typename _Tp, typename _Alloc>
-    void deque<_Tp,_Alloc>::
+    void deque<_Tp, _Alloc>::
     _M_pop_back_aux()
     {
       _M_deallocate_node(this->_M_impl._M_finish._M_first);
@@ -388,7 +388,7 @@
   //   _M_impl._M_start._M_cur == _M_impl._M_start._M_last,
   // then the deque must have at least two nodes.
   template <typename _Tp, typename _Alloc>
-    void deque<_Tp,_Alloc>::
+    void deque<_Tp, _Alloc>::
     _M_pop_front_aux()
     {
       std::_Destroy(this->_M_impl._M_start._M_cur);
@@ -400,7 +400,7 @@
   template <typename _Tp, typename _Alloc>
     template <typename _InputIterator>
       void
-      deque<_Tp,_Alloc>::
+      deque<_Tp, _Alloc>::
       _M_range_insert_aux(iterator __pos,
                           _InputIterator __first, _InputIterator __last,
                           input_iterator_tag)
@@ -409,12 +409,12 @@
   template <typename _Tp, typename _Alloc>
     template <typename _ForwardIterator>
       void
-      deque<_Tp,_Alloc>::
+      deque<_Tp, _Alloc>::
       _M_range_insert_aux(iterator __pos,
                           _ForwardIterator __first, _ForwardIterator __last,
                           forward_iterator_tag)
       {
-        size_type __n = std::distance(__first, __last);
+        const size_type __n = std::distance(__first, __last);
         if (__pos._M_cur == this->_M_impl._M_start._M_cur)
 	  {
 	    iterator __new_start = _M_reserve_elements_at_front(__n);
@@ -452,7 +452,7 @@
 
   template <typename _Tp, typename _Alloc>
     typename deque<_Tp, _Alloc>::iterator
-    deque<_Tp,_Alloc>::
+    deque<_Tp, _Alloc>::
     _M_insert_aux(iterator __pos, const value_type& __x)
     {
       difference_type __index = __pos - this->_M_impl._M_start;
@@ -485,11 +485,11 @@
 
   template <typename _Tp, typename _Alloc>
     void
-    deque<_Tp,_Alloc>::
+    deque<_Tp, _Alloc>::
     _M_insert_aux(iterator __pos, size_type __n, const value_type& __x)
     {
       const difference_type __elems_before = __pos - this->_M_impl._M_start;
-      size_type __length = this->size();
+      const size_type __length = this->size();
       value_type __x_copy = __x;
       if (__elems_before < difference_type(__length / 2))
 	{
@@ -566,13 +566,13 @@
   template <typename _Tp, typename _Alloc>
     template <typename _ForwardIterator>
       void
-      deque<_Tp,_Alloc>::
+      deque<_Tp, _Alloc>::
       _M_insert_aux(iterator __pos,
                     _ForwardIterator __first, _ForwardIterator __last,
                     size_type __n)
       {
         const difference_type __elemsbefore = __pos - this->_M_impl._M_start;
-        size_type __length = size();
+        const size_type __length = size();
         if (static_cast<size_type>(__elemsbefore) < __length / 2)
 	  {
 	    iterator __new_start = _M_reserve_elements_at_front(__n);
@@ -650,10 +650,10 @@
 
   template <typename _Tp, typename _Alloc>
     void
-    deque<_Tp,_Alloc>::
+    deque<_Tp, _Alloc>::
     _M_new_elements_at_front(size_type __new_elems)
     {
-      size_type __new_nodes
+      const size_type __new_nodes
 	= (__new_elems + _S_buffer_size() - 1) / _S_buffer_size();
       _M_reserve_map_at_front(__new_nodes);
       size_type __i;
@@ -672,11 +672,11 @@
 
   template <typename _Tp, typename _Alloc>
     void
-    deque<_Tp,_Alloc>::
+    deque<_Tp, _Alloc>::
     _M_new_elements_at_back(size_type __new_elems)
     {
-      size_type __new_nodes
-          = (__new_elems + _S_buffer_size() - 1) / _S_buffer_size();
+      const size_type __new_nodes
+	= (__new_elems + _S_buffer_size() - 1) / _S_buffer_size();
       _M_reserve_map_at_back(__new_nodes);
       size_type __i;
       try
@@ -694,12 +694,12 @@
 
   template <typename _Tp, typename _Alloc>
     void
-    deque<_Tp,_Alloc>::
+    deque<_Tp, _Alloc>::
     _M_reallocate_map(size_type __nodes_to_add, bool __add_at_front)
     {
-      size_type __old_num_nodes
+      const size_type __old_num_nodes
 	= this->_M_impl._M_finish._M_node - this->_M_impl._M_start._M_node + 1;
-      size_type __new_num_nodes = __old_num_nodes + __nodes_to_add;
+      const size_type __new_num_nodes = __old_num_nodes + __nodes_to_add;
 
       _Map_pointer __new_nstart;
       if (this->_M_impl._M_map_size > 2 * __new_num_nodes)
diff -urN libstdc++-v3-orig/include/bits/stl_algobase.h libstdc++-v3/include/bits/stl_algobase.h
--- libstdc++-v3-orig/include/bits/stl_algobase.h	2004-07-02 16:49:09.000000000 +0200
+++ libstdc++-v3/include/bits/stl_algobase.h	2004-07-04 19:14:40.000000000 +0200
@@ -721,8 +721,8 @@
 	    typename iterator_traits<_InputIterator1>::value_type,
 	    typename iterator_traits<_InputIterator2>::value_type>)
       __glibcxx_requires_valid_range(__first1, __last1);
-
-      for ( ; __first1 != __last1; ++__first1, ++__first2)
+      
+      for (; __first1 != __last1; ++__first1, ++__first2)
 	if (!(*__first1 == *__first2))
 	  return false;
       return true;
@@ -753,7 +753,7 @@
       __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
       __glibcxx_requires_valid_range(__first1, __last1);
 
-      for ( ; __first1 != __last1; ++__first1, ++__first2)
+      for (; __first1 != __last1; ++__first1, ++__first2)
 	if (!__binary_pred(*__first1, *__first2))
 	  return false;
       return true;
@@ -788,7 +788,8 @@
       __glibcxx_requires_valid_range(__first1, __last1);
       __glibcxx_requires_valid_range(__first2, __last2);
 
-      for (;__first1 != __last1 && __first2 != __last2; ++__first1, ++__first2)
+      for (; __first1 != __last1 && __first2 != __last2;
+	   ++__first1, ++__first2)
 	{
 	  if (*__first1 < *__first2)
 	    return true;
@@ -823,8 +824,8 @@
       __glibcxx_requires_valid_range(__first1, __last1);
       __glibcxx_requires_valid_range(__first2, __last2);
 
-      for ( ; __first1 != __last1 && __first2 != __last2
-	    ; ++__first1, ++__first2)
+      for (; __first1 != __last1 && __first2 != __last2;
+	   ++__first1, ++__first2)
 	{
 	  if (__comp(*__first1, *__first2))
 	    return true;
diff -urN libstdc++-v3-orig/include/bits/stl_bvector.h libstdc++-v3/include/bits/stl_bvector.h
--- libstdc++-v3-orig/include/bits/stl_bvector.h	2004-04-18 07:04:58.000000000 +0200
+++ libstdc++-v3/include/bits/stl_bvector.h	2004-07-04 18:58:18.000000000 +0200
@@ -323,7 +323,8 @@
     }
 
     const_iterator 
-    operator+(difference_type __i) const {
+    operator+(difference_type __i) const
+    {
       const_iterator __tmp = *this;
       return __tmp += __i;
     }
diff -urN libstdc++-v3-orig/include/bits/stl_construct.h libstdc++-v3/include/bits/stl_construct.h
--- libstdc++-v3-orig/include/bits/stl_construct.h	2004-02-08 05:46:41.000000000 +0100
+++ libstdc++-v3/include/bits/stl_construct.h	2004-07-04 18:51:39.000000000 +0200
@@ -117,7 +117,10 @@
     inline void
     __destroy_aux(_ForwardIterator __first, _ForwardIterator __last,
 		  __false_type)
-    { for ( ; __first != __last; ++__first) std::_Destroy(&*__first); }
+    {
+      for (; __first != __last; ++__first)
+	std::_Destroy(&*__first);
+    }
 
   /**
    * @if maint
diff -urN libstdc++-v3-orig/include/bits/stl_deque.h libstdc++-v3/include/bits/stl_deque.h
--- libstdc++-v3-orig/include/bits/stl_deque.h	2004-06-23 00:22:14.000000000 +0200
+++ libstdc++-v3/include/bits/stl_deque.h	2004-07-04 19:04:37.000000000 +0200
@@ -419,15 +419,16 @@
     };
 
   template<typename _Tp, typename _Alloc>
-  _Deque_base<_Tp,_Alloc>::~_Deque_base()
-  {
-    if (this->_M_impl._M_map)
+    _Deque_base<_Tp, _Alloc>::
+    ~_Deque_base()
     {
-      _M_destroy_nodes(this->_M_impl._M_start._M_node,
-		       this->_M_impl._M_finish._M_node + 1);
-      _M_deallocate_map(this->_M_impl._M_map, this->_M_impl._M_map_size);
+      if (this->_M_impl._M_map)
+	{
+	  _M_destroy_nodes(this->_M_impl._M_start._M_node,
+			   this->_M_impl._M_finish._M_node + 1);
+	  _M_deallocate_map(this->_M_impl._M_map, this->_M_impl._M_map_size);
+	}
     }
-  }
 
   /**
    *  @if maint
@@ -441,12 +442,14 @@
   */
   template<typename _Tp, typename _Alloc>
     void
-    _Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t __num_elements)
+    _Deque_base<_Tp, _Alloc>::
+    _M_initialize_map(size_t __num_elements)
     {
-      size_t __num_nodes = __num_elements / __deque_buf_size(sizeof(_Tp)) + 1;
+      const size_t __num_nodes = (__num_elements / __deque_buf_size(sizeof(_Tp))
+				  + 1);
 
       this->_M_impl._M_map_size = std::max((size_t) _S_initial_map_size,
-				   size_t(__num_nodes + 2));
+					   size_t(__num_nodes + 2));
       this->_M_impl._M_map = _M_allocate_map(this->_M_impl._M_map_size);
 
       // For "small" maps (needing less than _M_map_size nodes), allocation
@@ -478,7 +481,8 @@
 
   template<typename _Tp, typename _Alloc>
     void
-    _Deque_base<_Tp,_Alloc>::_M_create_nodes(_Tp** __nstart, _Tp** __nfinish)
+    _Deque_base<_Tp, _Alloc>::
+    _M_create_nodes(_Tp** __nstart, _Tp** __nfinish)
     {
       _Tp** __cur;
       try
@@ -495,7 +499,8 @@
 
   template<typename _Tp, typename _Alloc>
     void
-    _Deque_base<_Tp,_Alloc>::_M_destroy_nodes(_Tp** __nstart, _Tp** __nfinish)
+    _Deque_base<_Tp, _Alloc>::
+    _M_destroy_nodes(_Tp** __nstart, _Tp** __nfinish)
     {
       for (_Tp** __n = __nstart; __n < __nfinish; ++__n)
 	_M_deallocate_node(*__n);
@@ -923,7 +928,10 @@
        */
       reference
       at(size_type __n)
-      { _M_range_check(__n); return (*this)[__n]; }
+      {
+	_M_range_check(__n);
+	return (*this)[__n];
+      }
 
       /**
        *  @brief  Provides access to the data contained in the %deque.
diff -urN libstdc++-v3-orig/include/bits/stl_pair.h libstdc++-v3/include/bits/stl_pair.h
--- libstdc++-v3-orig/include/bits/stl_pair.h	2004-05-13 14:50:52.000000000 +0200
+++ libstdc++-v3/include/bits/stl_pair.h	2004-07-04 18:57:43.000000000 +0200
@@ -141,7 +141,8 @@
   // 181.  make_pair() unintended behavior
   template<class _T1, class _T2>
     inline pair<_T1, _T2>
-    make_pair(_T1 __x, _T2 __y) { return pair<_T1, _T2>(__x, __y); }
+    make_pair(_T1 __x, _T2 __y)
+    { return pair<_T1, _T2>(__x, __y); }
 } // namespace std
 
 #endif /* _PAIR_H */
diff -urN libstdc++-v3-orig/include/bits/stl_vector.h libstdc++-v3/include/bits/stl_vector.h
--- libstdc++-v3-orig/include/bits/stl_vector.h	2004-06-09 23:37:46.000000000 +0200
+++ libstdc++-v3/include/bits/stl_vector.h	2004-07-04 19:22:22.000000000 +0200
@@ -81,7 +81,7 @@
 	_Tp*           _M_start;
 	_Tp*           _M_finish;
 	_Tp*           _M_end_of_storage;
-	_Vector_impl (_Alloc const& __a)
+	_Vector_impl(_Alloc const& __a)
 	: _Alloc(__a), _M_start(0), _M_finish(0), _M_end_of_storage(0)
 	{ }
       };
@@ -799,7 +799,7 @@
         _M_range_initialize(_InputIterator __first,
 			    _InputIterator __last, input_iterator_tag)
         {
-	  for ( ; __first != __last; ++__first)
+	  for (; __first != __last; ++__first)
 	    push_back(*__first);
 	}
 
@@ -809,7 +809,7 @@
         _M_range_initialize(_ForwardIterator __first,
 			    _ForwardIterator __last, forward_iterator_tag)
         {
-	  size_type __n = std::distance(__first, __last);
+	  const size_type __n = std::distance(__first, __last);
 	  this->_M_impl._M_start = this->_M_allocate(__n);
 	  this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
 	  this->_M_impl._M_finish = std::uninitialized_copy(__first, __last,
diff -urN libstdc++-v3-orig/include/bits/vector.tcc libstdc++-v3/include/bits/vector.tcc
--- libstdc++-v3-orig/include/bits/vector.tcc	2004-04-26 11:02:43.000000000 +0200
+++ libstdc++-v3/include/bits/vector.tcc	2004-07-04 19:02:08.000000000 +0200
@@ -91,7 +91,7 @@
     vector<_Tp, _Alloc>::
     insert(iterator __position, const value_type& __x)
     {
-      size_type __n = __position - begin();
+      const size_type __n = __position - begin();
       if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage
 	  && __position == end())
 	{
@@ -193,7 +193,7 @@
 		    input_iterator_tag)
       {
 	iterator __cur(begin());
-	for ( ; __first != __last && __cur != end(); ++__cur, ++__first)
+	for (; __first != __last && __cur != end(); ++__cur, ++__first)
 	  *__cur = *__first;
 	if (__first == __last)
 	  erase(__cur, end());
@@ -204,11 +204,11 @@
   template<typename _Tp, typename _Alloc>
     template<typename _ForwardIterator>
       void
-      vector<_Tp,_Alloc>::
+      vector<_Tp, _Alloc>::
       _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
 		    forward_iterator_tag)
       {
-	size_type __len = std::distance(__first, __last);
+	const size_type __len = std::distance(__first, __last);
 
 	if (__len > capacity())
 	  {
@@ -242,7 +242,7 @@
 
   template<typename _Tp, typename _Alloc>
     void
-    vector<_Tp,_Alloc>::
+    vector<_Tp, _Alloc>::
     _M_insert_aux(iterator __position, const _Tp& __x)
     {
       if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
@@ -293,7 +293,7 @@
 
   template<typename _Tp, typename _Alloc>
     void
-    vector<_Tp,_Alloc>::
+    vector<_Tp, _Alloc>::
     _M_fill_insert(iterator __position, size_type __n, const value_type& __x)
     {
       if (__n != 0)
@@ -360,11 +360,11 @@
 
   template<typename _Tp, typename _Alloc> template<typename _InputIterator>
     void
-    vector<_Tp,_Alloc>::
+    vector<_Tp, _Alloc>::
     _M_range_insert(iterator __pos, _InputIterator __first,
 		    _InputIterator __last, input_iterator_tag)
     {
-      for ( ; __first != __last; ++__first)
+      for (; __first != __last; ++__first)
 	{
 	  __pos = insert(__pos, *__first);
 	  ++__pos;
@@ -374,13 +374,13 @@
   template<typename _Tp, typename _Alloc>
     template<typename _ForwardIterator>
       void
-      vector<_Tp,_Alloc>::
+      vector<_Tp, _Alloc>::
       _M_range_insert(iterator __position,_ForwardIterator __first,
 		      _ForwardIterator __last, forward_iterator_tag)
       {
 	if (__first != __last)
 	  {
-	    size_type __n = std::distance(__first, __last);
+	    const size_type __n = std::distance(__first, __last);
 	    if (size_type(this->_M_impl._M_end_of_storage
 			  - this->_M_impl._M_finish) >= __n)
 	      {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]