stl_iterator_base_funcs.h: Minor formatting and indentation tweaks.
2004-02-03 Paolo Carlini <pcarlini@suse.de> * include/bits/stl_iterator_base_funcs.h: Minor formatting and indentation tweaks. * include/bits/stl_iterator_base_types.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/stl_map.h: Likewise. * include/bits/stl_tempbuf.h: Likewise. From-SVN: r77182
This commit is contained in:
parent
e621b5885a
commit
83042fcaec
@ -1,3 +1,12 @@
|
||||
2004-02-03 Paolo Carlini <pcarlini@suse.de>
|
||||
|
||||
* include/bits/stl_iterator_base_funcs.h: Minor formatting
|
||||
and indentation tweaks.
|
||||
* include/bits/stl_iterator_base_types.h: Likewise.
|
||||
* include/bits/stl_list.h: Likewise.
|
||||
* include/bits/stl_map.h: Likewise.
|
||||
* include/bits/stl_tempbuf.h: Likewise.
|
||||
|
||||
2004-02-02 Jerry Quinn <jlquinn@optonline.net>
|
||||
|
||||
* include/bits/gslice.h, include/bits/gslice_array.h,
|
||||
|
@ -137,9 +137,11 @@ namespace std
|
||||
__glibcxx_function_requires(_BidirectionalIteratorConcept<
|
||||
_BidirectionalIterator>)
|
||||
if (__n > 0)
|
||||
while (__n--) ++__i;
|
||||
while (__n--)
|
||||
++__i;
|
||||
else
|
||||
while (__n++) --__i;
|
||||
while (__n++)
|
||||
--__i;
|
||||
}
|
||||
|
||||
template<typename _RandomAccessIterator, typename _Distance>
|
||||
|
@ -124,7 +124,8 @@ namespace std
|
||||
* provide tighter, more correct semantics.
|
||||
*/
|
||||
template<typename _Iterator>
|
||||
struct iterator_traits {
|
||||
struct iterator_traits
|
||||
{
|
||||
typedef typename _Iterator::iterator_category iterator_category;
|
||||
typedef typename _Iterator::value_type value_type;
|
||||
typedef typename _Iterator::difference_type difference_type;
|
||||
@ -133,7 +134,8 @@ namespace std
|
||||
};
|
||||
|
||||
template<typename _Tp>
|
||||
struct iterator_traits<_Tp*> {
|
||||
struct iterator_traits<_Tp*>
|
||||
{
|
||||
typedef random_access_iterator_tag iterator_category;
|
||||
typedef _Tp value_type;
|
||||
typedef ptrdiff_t difference_type;
|
||||
@ -142,7 +144,8 @@ namespace std
|
||||
};
|
||||
|
||||
template<typename _Tp>
|
||||
struct iterator_traits<const _Tp*> {
|
||||
struct iterator_traits<const _Tp*>
|
||||
{
|
||||
typedef random_access_iterator_tag iterator_category;
|
||||
typedef _Tp value_type;
|
||||
typedef ptrdiff_t difference_type;
|
||||
|
@ -76,15 +76,21 @@ namespace __gnu_norm
|
||||
_List_node_base* _M_next; ///< Self-explanatory
|
||||
_List_node_base* _M_prev; ///< Self-explanatory
|
||||
|
||||
static void swap(_List_node_base& __x,
|
||||
_List_node_base& __y);
|
||||
static void
|
||||
swap(_List_node_base& __x, _List_node_base& __y);
|
||||
|
||||
void transfer(_List_node_base * const __first,
|
||||
_List_node_base * const __last);
|
||||
void
|
||||
transfer(_List_node_base * const __first,
|
||||
_List_node_base * const __last);
|
||||
|
||||
void reverse();
|
||||
void hook(_List_node_base * const __position);
|
||||
void unhook();
|
||||
void
|
||||
reverse();
|
||||
|
||||
void
|
||||
hook(_List_node_base * const __position);
|
||||
|
||||
void
|
||||
unhook();
|
||||
};
|
||||
|
||||
/// @if maint An actual node in the %list. @endif
|
||||
@ -286,6 +292,7 @@ namespace __gnu_norm
|
||||
// allocator_type and _Node_Alloc_type. The conversion is
|
||||
// required by table 32 in [20.1.5].
|
||||
typedef typename _Alloc::template rebind<_List_node<_Tp> >::other
|
||||
|
||||
_Node_Alloc_type;
|
||||
|
||||
_List_node_base _M_node;
|
||||
|
@ -336,7 +336,7 @@ namespace __gnu_norm
|
||||
iterator __i = lower_bound(__k);
|
||||
// __i->first is greater than or equivalent to __k.
|
||||
if (__i == end() || key_comp()(__k, (*__i).first))
|
||||
__i = insert(__i, value_type(__k, mapped_type()));
|
||||
__i = insert(__i, value_type(__k, mapped_type()));
|
||||
return (*__i).second;
|
||||
}
|
||||
|
||||
|
@ -132,7 +132,9 @@ namespace std
|
||||
private:
|
||||
// Disable copy constructor and assignment operator.
|
||||
_Temporary_buffer(const _Temporary_buffer&);
|
||||
void operator=(const _Temporary_buffer&);
|
||||
|
||||
void
|
||||
operator=(const _Temporary_buffer&);
|
||||
};
|
||||
|
||||
|
||||
@ -140,27 +142,28 @@ namespace std
|
||||
_Temporary_buffer<_ForwardIterator, _Tp>::
|
||||
_Temporary_buffer(_ForwardIterator __first, _ForwardIterator __last)
|
||||
: _M_original_len(std::distance(__first, __last)),
|
||||
_M_len(0) , _M_buffer(0)
|
||||
_M_len(0), _M_buffer(0)
|
||||
{
|
||||
// Workaround for a __type_traits bug in the pre-7.3 compiler.
|
||||
typedef typename __type_traits<_Tp>::has_trivial_default_constructor
|
||||
_Trivial;
|
||||
|
||||
try
|
||||
{
|
||||
pair<pointer, size_type> __p(get_temporary_buffer<value_type>(_M_original_len));
|
||||
_M_buffer = __p.first;
|
||||
_M_len = __p.second;
|
||||
if (_M_len > 0)
|
||||
_M_initialize_buffer(*__first, _Trivial());
|
||||
}
|
||||
{
|
||||
pair<pointer, size_type> __p(get_temporary_buffer<
|
||||
value_type>(_M_original_len));
|
||||
_M_buffer = __p.first;
|
||||
_M_len = __p.second;
|
||||
if (_M_len > 0)
|
||||
_M_initialize_buffer(*__first, _Trivial());
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
std::return_temporary_buffer(_M_buffer);
|
||||
_M_buffer = 0;
|
||||
_M_len = 0;
|
||||
__throw_exception_again;
|
||||
}
|
||||
{
|
||||
std::return_temporary_buffer(_M_buffer);
|
||||
_M_buffer = 0;
|
||||
_M_len = 0;
|
||||
__throw_exception_again;
|
||||
}
|
||||
}
|
||||
} // namespace std
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user