diff -r e1b950c65cb4 -r 837f303aceeb epoc32/include/stdapis/stlportv5/stl/_iterator_base.h --- a/epoc32/include/stdapis/stlportv5/stl/_iterator_base.h Wed Mar 31 12:27:01 2010 +0100 +++ b/epoc32/include/stdapis/stlportv5/stl/_iterator_base.h Wed Mar 31 12:33:34 2010 +0100 @@ -9,13 +9,13 @@ * Copyright (c) 1997 * Moscow Center for SPARC Technology * - * Copyright (c) 1999 + * Copyright (c) 1999 * Boris Fomitchev * * This material is provided "as is", with absolutely no warranty expressed * or implied. Any use is at your own risk. * - * Permission to use or copy this software for any purpose is hereby granted + * Permission to use or copy this software for any purpose is hereby granted * without fee, provided the above notices are retained on all copies. * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was @@ -30,18 +30,20 @@ #ifndef _STLP_INTERNAL_ITERATOR_BASE_H #define _STLP_INTERNAL_ITERATOR_BASE_H -#ifndef _STLP_CSTDDEF -# include +#ifndef _STLP_INTERNAL_CSTDDEF +# include #endif -# if defined (_STLP_IMPORT_VENDOR_CSTD) && ! defined (_STLP_VENDOR_GLOBAL_CSTD) -_STLP_BEGIN_NAMESPACE -using namespace _STLP_VENDOR_CSTD; -_STLP_END_NAMESPACE -#endif /* _STLP_IMPORT_VENDOR_CSTD */ +//# if defined (_STLP_IMPORT_VENDOR_CSTD) && ! defined (_STLP_VENDOR_GLOBAL_CSTD) +//_STLP_BEGIN_NAMESPACE +//using namespace _STLP_VENDOR_CSTD; +//_STLP_END_NAMESPACE +//#endif /* _STLP_IMPORT_VENDOR_CSTD */ -#ifndef __TYPE_TRAITS_H -# include +#if !defined(_STLP_USE_OLD_HP_ITERATOR_QUERIES) && !defined(_STLP_CLASS_PARTIAL_SPECIALIZATION) +# ifndef _STLP_TYPE_TRAITS_H +# include +# endif #endif _STLP_BEGIN_NAMESPACE @@ -53,8 +55,8 @@ struct random_access_iterator_tag : public bidirectional_iterator_tag {}; -template +template struct iterator { typedef _Category iterator_category; typedef _Tp value_type; @@ -73,25 +75,30 @@ #endif }; -# ifdef _STLP_USE_OLD_HP_ITERATOR_QUERIES +#if defined (_STLP_USE_OLD_HP_ITERATOR_QUERIES) # define _STLP_ITERATOR_CATEGORY(_It, _Tp) iterator_category(_It) # define _STLP_DISTANCE_TYPE(_It, _Tp) distance_type(_It) # define _STLP_VALUE_TYPE(_It, _Tp) value_type(_It) -# else -# ifdef _STLP_CLASS_PARTIAL_SPECIALIZATION -# define _STLP_VALUE_TYPE(_It, _Tp) (typename iterator_traits< _Tp >::value_type*)0 -# define _STLP_DISTANCE_TYPE(_It, _Tp) (typename iterator_traits< _Tp >::difference_type*)0 -# if defined (__BORLANDC__) || defined (__SUNPRO_CC) || ( defined (__MWERKS__) && (__MWERKS__ <= 0x2303)) || ( defined (__sgi) && defined (_COMPILER_VERSION)) || defined (__DMC__) -# define _STLP_ITERATOR_CATEGORY(_It, _Tp) iterator_traits< _Tp >::iterator_category() -# else -# define _STLP_ITERATOR_CATEGORY(_It, _Tp) typename iterator_traits< _Tp >::iterator_category() -# endif +//Old HP iterator queries do not give information about the iterator +//associated reference type so we consider that it is not a real reference. +# define _STLP_IS_REF_TYPE_REAL_REF(_It, _Tp) __false_type() +#else +# if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION) +# define _STLP_VALUE_TYPE(_It, _Tp) (typename iterator_traits< _Tp >::value_type*)0 +# define _STLP_DISTANCE_TYPE(_It, _Tp) (typename iterator_traits< _Tp >::difference_type*)0 +# if defined (__BORLANDC__) || defined (__SUNPRO_CC) || ( defined (__MWERKS__) && (__MWERKS__ <= 0x2303)) || ( defined (__sgi) && defined (_COMPILER_VERSION)) || defined (__DMC__) +# define _STLP_ITERATOR_CATEGORY(_It, _Tp) iterator_traits< _Tp >::iterator_category() +# else +# define _STLP_ITERATOR_CATEGORY(_It, _Tp) typename iterator_traits< _Tp >::iterator_category() +# endif +# define _STLP_IS_REF_TYPE_REAL_REF(_It, _Tp) _IsRefType< typename iterator_traits< _Tp >::reference >::_Ret() # else -# define _STLP_ITERATOR_CATEGORY(_It, _Tp) __iterator_category(_It, _IsPtrType<_Tp>::_Ret()) -# define _STLP_DISTANCE_TYPE(_It, _Tp) (ptrdiff_t*)0 -# define _STLP_VALUE_TYPE(_It, _Tp) __value_type(_It, _IsPtrType<_Tp>::_Ret() ) +# define _STLP_ITERATOR_CATEGORY(_It, _Tp) __iterator_category(_It, _IsPtrType<_Tp>::_Ret()) +# define _STLP_DISTANCE_TYPE(_It, _Tp) (ptrdiff_t*)0 +# define _STLP_VALUE_TYPE(_It, _Tp) __value_type(_It, _IsPtrType<_Tp>::_Ret() ) +# define _STLP_IS_REF_TYPE_REAL_REF(_It, _Tp) __false_type() # endif -# endif +#endif template struct iterator_traits { @@ -103,18 +110,18 @@ }; -# if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION) && ! defined (__SUNPRO_CC) +#if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION) && ! defined (__SUNPRO_CC) # define _STLP_DIFFERENCE_TYPE(_Iterator) typename iterator_traits<_Iterator>::difference_type -# else +#else # define _STLP_DIFFERENCE_TYPE(_Iterator) ptrdiff_t -# endif +#endif -# ifdef _STLP_CLASS_PARTIAL_SPECIALIZATION +#ifdef _STLP_CLASS_PARTIAL_SPECIALIZATION // fbp : this order keeps gcc happy template struct iterator_traits { - typedef random_access_iterator_tag iterator_category; + typedef random_access_iterator_tag iterator_category; typedef _Tp value_type; typedef ptrdiff_t difference_type; typedef const _Tp* pointer; @@ -123,7 +130,7 @@ template struct iterator_traits<_Tp*> { - typedef random_access_iterator_tag iterator_category; + typedef random_access_iterator_tag iterator_category; typedef _Tp value_type; typedef ptrdiff_t difference_type; typedef _Tp* pointer; @@ -133,7 +140,7 @@ # if defined (__BORLANDC__) template struct iterator_traits<_Tp* const> { - typedef random_access_iterator_tag iterator_category; + typedef random_access_iterator_tag iterator_category; typedef _Tp value_type; typedef ptrdiff_t difference_type; typedef const _Tp* pointer; @@ -141,25 +148,25 @@ }; # endif -# endif /* _STLP_CLASS_PARTIAL_SPECIALIZATION */ +#endif /* _STLP_CLASS_PARTIAL_SPECIALIZATION */ -# if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION) \ - || (defined (_STLP_SIMULATE_PARTIAL_SPEC_FOR_TYPE_TRAITS) && ! defined (_STLP_NO_ARROW_OPERATOR)) +#if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION) || \ + (defined (_STLP_SIMULATE_PARTIAL_SPEC_FOR_TYPE_TRAITS) && ! defined (_STLP_NO_ARROW_OPERATOR)) # define _STLP_POINTERS_SPECIALIZE( _TpP ) # define _STLP_DEFINE_ARROW_OPERATOR pointer operator->() const { return &(operator*()); } -# else +#else # include -# endif +#endif -# ifndef _STLP_USE_OLD_HP_ITERATOR_QUERIES +#ifndef _STLP_USE_OLD_HP_ITERATOR_QUERIES // The overloaded functions iterator_category, distance_type, and // value_type are not part of the C++ standard. (They have been // replaced by struct iterator_traits.) They are included for // backward compatibility with the HP STL. // We introduce internal names for these functions. -# ifdef _STLP_CLASS_PARTIAL_SPECIALIZATION +# ifdef _STLP_CLASS_PARTIAL_SPECIALIZATION template inline typename iterator_traits<_Iter>::iterator_category __iterator_category(const _Iter&) { @@ -179,10 +186,10 @@ return __STATIC_CAST(_value_type*,0); } -# else +# else /* _STLP_CLASS_PARTIAL_SPECIALIZATION */ template -inline random_access_iterator_tag +inline random_access_iterator_tag __iterator_category(const _Iter&, const __true_type&) { return random_access_iterator_tag(); } @@ -196,36 +203,36 @@ template -inline ptrdiff_t* _STLP_CALL __distance_type(const _Iter&) { return (ptrdiff_t*)(0); } +inline ptrdiff_t* _STLP_CALL __distance_type(const _Iter&) { return __STATIC_CAST(ptrdiff_t*, 0); } template -inline _STLP_TYPENAME_ON_RETURN_TYPE iterator_traits<_Iter>::value_type* +inline _STLP_TYPENAME_ON_RETURN_TYPE iterator_traits<_Iter>::value_type* __value_type(const _Iter&, const __false_type&) { typedef typename iterator_traits<_Iter>::value_type _value_type; return __STATIC_CAST(_value_type*,0); } template -inline _Tp* +inline _Tp* __value_type(const _Tp*, const __true_type&) { return __STATIC_CAST(_Tp*, 0); } -# endif +# endif /* _STLP_CLASS_PARTIAL_SPECIALIZATION */ -#else /* old queries */ +#else /* _STLP_USE_OLD_HP_ITERATOR_QUERIES */ template inline _Category _STLP_CALL iterator_category(const iterator<_Category,_Tp,_Distance,_Pointer,_Reference>&) { return _Category(); } template -inline _Tp* _STLP_CALL value_type(const iterator<_Category,_Tp,_Distance,_Pointer,_Reference>&) { return (_Tp*)(0); } +inline _Tp* _STLP_CALL value_type(const iterator<_Category,_Tp,_Distance,_Pointer,_Reference>&) { return __STATIC_CAST(_Tp*, 0); } template -inline _Distance* _STLP_CALL distance_type(const iterator<_Category,_Tp,_Distance,_Pointer,_Reference>&) { return (_Distance*)(0); } +inline _Distance* _STLP_CALL distance_type(const iterator<_Category,_Tp,_Distance,_Pointer,_Reference>&) { return __STATIC_CAST(_Distance*, 0); } template inline random_access_iterator_tag _STLP_CALL iterator_category(const _Tp*) { return random_access_iterator_tag(); } template -inline _Tp* _STLP_CALL value_type(const _Tp*) { return (_Tp*)(0); } +inline _Tp* _STLP_CALL value_type(const _Tp*) { return __STATIC_CAST(_Tp*, 0); } template -inline ptrdiff_t* _STLP_CALL distance_type(const _Tp*) { return (ptrdiff_t*)(0); } +inline ptrdiff_t* _STLP_CALL distance_type(const _Tp*) { return __STATIC_CAST(ptrdiff_t*, 0); } #endif /* _STLP_USE_OLD_HP_ITERATOR_QUERIES */ # if ! defined (_STLP_NO_ANACHRONISMS) @@ -233,7 +240,7 @@ // bidirectional_iterator, and random_access_iterator are not part of // the C++ standard. (They have been replaced by struct iterator.) // They are included for backward compatibility with the HP STL. -template struct input_iterator : +template struct input_iterator : public iterator {}; struct output_iterator : public iterator {}; template struct forward_iterator : @@ -244,75 +251,76 @@ public iterator {}; # if defined (_STLP_BASE_MATCH_BUG) && defined (_STLP_USE_OLD_HP_ITERATOR_QUERIES) -template -inline input_iterator_tag _STLP_CALL +template +inline input_iterator_tag _STLP_CALL iterator_category(const input_iterator<_Tp, _Distance>&) { return input_iterator_tag(); } inline output_iterator_tag _STLP_CALL iterator_category(const output_iterator&) { return output_iterator_tag(); } -template +template inline forward_iterator_tag _STLP_CALL iterator_category(const forward_iterator<_Tp, _Distance>&) { return forward_iterator_tag(); } -template -inline bidirectional_iterator_tag _STLP_CALL +template +inline bidirectional_iterator_tag _STLP_CALL iterator_category(const bidirectional_iterator<_Tp, _Distance>&) { return bidirectional_iterator_tag(); } -template +template inline random_access_iterator_tag _STLP_CALL iterator_category(const random_access_iterator<_Tp, _Distance>&) { return random_access_iterator_tag(); } -template -inline _Tp* _STLP_CALL value_type(const input_iterator<_Tp, _Distance>&) { return (_Tp*)(0); } -template -inline _Tp* _STLP_CALL value_type(const forward_iterator<_Tp, _Distance>&) { return (_Tp*)(0); } -template -inline _Tp* _STLP_CALL value_type(const bidirectional_iterator<_Tp, _Distance>&) { return (_Tp*)(0); } -template -inline _Tp* _STLP_CALL value_type(const random_access_iterator<_Tp, _Distance>&) { return (_Tp*)(0); } -template -inline _Distance* _STLP_CALL distance_type(const input_iterator<_Tp, _Distance>&) { return (_Distance*)(0); } -template -inline _Distance* _STLP_CALL distance_type(const forward_iterator<_Tp, _Distance>&) { return (_Distance*)(0); } -template -inline _Distance* _STLP_CALL distance_type(const bidirectional_iterator<_Tp, _Distance>&) { return (_Distance*)(0);} -template -inline _Distance* _STLP_CALL distance_type(const random_access_iterator<_Tp, _Distance>&) { return (_Distance*)(0); } +template +inline _Tp* _STLP_CALL value_type(const input_iterator<_Tp, _Distance>&) { return __STATIC_CAST(_Tp*, 0); } +template +inline _Tp* _STLP_CALL value_type(const forward_iterator<_Tp, _Distance>&) { return __STATIC_CAST(_Tp*, 0); } +template +inline _Tp* _STLP_CALL value_type(const bidirectional_iterator<_Tp, _Distance>&) { return __STATIC_CAST(_Tp*, 0); } +template +inline _Tp* _STLP_CALL value_type(const random_access_iterator<_Tp, _Distance>&) { return __STATIC_CAST(_Tp*, 0); } +template +inline _Distance* _STLP_CALL distance_type(const input_iterator<_Tp, _Distance>&) { return __STATIC_CAST(_Distance*, 0); } +template +inline _Distance* _STLP_CALL distance_type(const forward_iterator<_Tp, _Distance>&) { return __STATIC_CAST(_Distance*, 0); } +template +inline _Distance* _STLP_CALL distance_type(const bidirectional_iterator<_Tp, _Distance>&) { return __STATIC_CAST(_Distance*, 0);} +template +inline _Distance* _STLP_CALL distance_type(const random_access_iterator<_Tp, _Distance>&) { return __STATIC_CAST(_Distance*, 0); } # endif /* BASE_MATCH */ #endif /* _STLP_NO_ANACHRONISMS */ template inline void _STLP_CALL __distance(const _InputIterator& __first, const _InputIterator& __last, - _Distance& __n, const input_iterator_tag &) { + _Distance& __n, const input_iterator_tag &) { _InputIterator __it(__first); while (__it != __last) { ++__it; ++__n; } } -# if defined (_STLP_NONTEMPL_BASE_MATCH_BUG) + +# if defined (_STLP_NONTEMPL_BASE_MATCH_BUG) template inline void _STLP_CALL __distance(const _ForwardIterator& __first, const _ForwardIterator& __last, - _Distance& __n, const forward_iterator_tag &) { + _Distance& __n, const forward_iterator_tag &) { _ForwardIterator __it(__first); while (__it != __last) { ++__first; ++__n; } } template -_STLP_INLINE_LOOP void _STLP_CALL __distance(const _BidirectionalIterator& __first, - const _BidirectionalIterator& __last, - _Distance& __n, const bidirectional_iterator_tag &) { +_STLP_INLINE_LOOP void _STLP_CALL __distance(const _BidirectionalIterator& __first, + const _BidirectionalIterator& __last, + _Distance& __n, const bidirectional_iterator_tag &) { _BidirectionalIterator __it(__first); while (__it != __last) { ++__it; ++__n; } } # endif template -inline void _STLP_CALL __distance(const _RandomAccessIterator& __first, - const _RandomAccessIterator& __last, - _Distance& __n, const random_access_iterator_tag &) { +inline void _STLP_CALL __distance(const _RandomAccessIterator& __first, + const _RandomAccessIterator& __last, + _Distance& __n, const random_access_iterator_tag &) { __n += __last - __first; } -#ifndef _STLP_NO_ANACHRONISMS +#ifndef _STLP_NO_ANACHRONISMS template -inline void _STLP_CALL distance(const _InputIterator& __first, - const _InputIterator& __last, _Distance& __n) { +inline void _STLP_CALL distance(const _InputIterator& __first, + const _InputIterator& __last, _Distance& __n) { __distance(__first, __last, __n, _STLP_ITERATOR_CATEGORY(__first, _InputIterator)); } #endif @@ -321,16 +329,16 @@ inline _STLP_DIFFERENCE_TYPE(_InputIterator) _STLP_CALL __distance(const _InputIterator& __first, const _InputIterator& __last, const input_iterator_tag &) { _STLP_DIFFERENCE_TYPE(_InputIterator) __n = 0; - _InputIterator __it(__first); + _InputIterator __it(__first); while (__it != __last) { ++__it; ++__n; } return __n; } -# if defined (_STLP_NONTEMPL_BASE_MATCH_BUG) +# if defined (_STLP_NONTEMPL_BASE_MATCH_BUG) template -inline _STLP_DIFFERENCE_TYPE(_ForwardIterator) _STLP_CALL +inline _STLP_DIFFERENCE_TYPE(_ForwardIterator) _STLP_CALL __distance(const _ForwardIterator& __first, const _ForwardIterator& __last, const forward_iterator_tag &) { @@ -340,11 +348,12 @@ ++__it; ++__n; } return __n; + } template -_STLP_INLINE_LOOP _STLP_DIFFERENCE_TYPE(_BidirectionalIterator) _STLP_CALL -__distance(const _BidirectionalIterator& __first, +_STLP_INLINE_LOOP _STLP_DIFFERENCE_TYPE(_BidirectionalIterator) _STLP_CALL +__distance(const _BidirectionalIterator& __first, const _BidirectionalIterator& __last, const bidirectional_iterator_tag &) { _STLP_DIFFERENCE_TYPE(_BidirectionalIterator) __n = 0; @@ -365,11 +374,10 @@ template inline _STLP_DIFFERENCE_TYPE(_InputIterator) _STLP_CALL -distance(const _InputIterator& __first, const _InputIterator& __last) { - return __distance(__first, __last, _STLP_ITERATOR_CATEGORY(__first, _InputIterator)); +distance(_InputIterator __first, _InputIterator __last) { + return __distance(__first, __last, _STLP_ITERATOR_CATEGORY(__first, _InputIterator)); } - // fbp: those are being used for iterator/const_iterator definitions everywhere template struct _Nonconst_traits; @@ -379,7 +387,8 @@ typedef _Tp value_type; typedef const _Tp& reference; typedef const _Tp* pointer; - typedef _Nonconst_traits<_Tp> _Non_const_traits; + typedef _Const_traits<_Tp> _ConstTraits; + typedef _Nonconst_traits<_Tp> _NonConstTraits; }; template @@ -387,51 +396,119 @@ typedef _Tp value_type; typedef _Tp& reference; typedef _Tp* pointer; - typedef _Nonconst_traits<_Tp> _Non_const_traits; + typedef _Const_traits<_Tp> _ConstTraits; + typedef _Nonconst_traits<_Tp> _NonConstTraits; }; +/* + * dums: A special iterator/const_iterator traits for set and multiset for which even + * the iterator is not mutable + */ +template +struct _Nonconst_Const_traits; + +template +struct _Const_Const_traits { + typedef _Tp value_type; + typedef const _Tp& reference; + typedef const _Tp* pointer; + typedef _Const_Const_traits<_Tp> _ConstTraits; + typedef _Nonconst_Const_traits<_Tp> _NonConstTraits; +}; + +template +struct _Nonconst_Const_traits { + typedef _Tp value_type; + typedef const _Tp& reference; + typedef const _Tp* pointer; + typedef _Const_Const_traits<_Tp> _ConstTraits; + typedef _Nonconst_Const_traits<_Tp> _NonConstTraits; +}; + +/* + * A macro to generate a new iterator traits from one of the + * previous one. Changing the iterator traits type make iterators + * from different containers not comparable. + */ +#define _STLP_CREATE_ITERATOR_TRAITS_BASE(Motif, Traits) \ +template \ +struct _##Motif; \ +template \ +struct _Const##Motif : public _STLP_STD::_Const_##Traits<_Tp> { \ + typedef _Const##Motif<_Tp> _ConstTraits; \ + typedef _##Motif<_Tp> _NonConstTraits; \ +}; \ +template \ +struct _##Motif : public _STLP_STD::_Nonconst_##Traits<_Tp> { \ + typedef _Const##Motif<_Tp> _ConstTraits; \ + typedef _##Motif<_Tp> _NonConstTraits; \ +}; + +#define _STLP_CREATE_ITERATOR_TRAITS(Motif, Traits) \ +_STLP_MOVE_TO_PRIV_NAMESPACE \ +_STLP_CREATE_ITERATOR_TRAITS_BASE(Motif, Traits) \ +_STLP_MOVE_TO_STD_NAMESPACE + +#define _STLP_CREATE_HASH_ITERATOR_TRAITS(Motif, Traits) \ +_STLP_MOVE_TO_PRIV_NAMESPACE \ +_STLP_CREATE_ITERATOR_TRAITS_BASE(NonLocal##Motif, Traits) \ +_STLP_CREATE_ITERATOR_TRAITS_BASE(Local##Motif, Traits) \ +template \ +struct _##Motif { \ + typedef _ConstNonLocal##Motif<_Tp> _ConstTraits; \ + typedef _NonLocal##Motif<_Tp> _NonConstTraits; \ + typedef _ConstLocal##Motif<_Tp> _ConstLocalTraits; \ + typedef _Local##Motif<_Tp> _NonConstLocalTraits; \ +}; \ +_STLP_MOVE_TO_STD_NAMESPACE + +/* # if defined (_STLP_BASE_TYPEDEF_BUG) // this workaround is needed for SunPro 4.0.1 template -struct __cnst_traits_aux : private _Traits -{ +struct __cnst_traits_aux : private _Traits { typedef typename _Traits::value_type value_type; }; # define __TRAITS_VALUE_TYPE(_Traits) __cnst_traits_aux<_Traits>::value_type # else # define __TRAITS_VALUE_TYPE(_Traits) _Traits::value_type # endif +*/ -# if defined (_STLP_MSVC) +#if defined (_STLP_MSVC) // MSVC specific template -inline void _STLP_CALL _Distance(_InputIterator __first, - _InputIterator __last, _Dist& __n) { +inline void _STLP_CALL _Distance(_InputIterator __first, + _InputIterator __last, _Dist& __n) { __distance(__first, __last, __n, _STLP_ITERATOR_CATEGORY(__first, _InputIterator)); } -# endif +#endif template -_STLP_INLINE_LOOP void _STLP_CALL __advance(_InputIter& __i, _Distance __n, const input_iterator_tag &) { +_STLP_INLINE_LOOP void _STLP_CALL +__advance(_InputIter& __i, _Distance __n, const input_iterator_tag &) { while (__n--) ++__i; } // fbp : added output iterator tag variant template -_STLP_INLINE_LOOP void _STLP_CALL __advance(_InputIter& __i, _Distance __n, const output_iterator_tag &) { +_STLP_INLINE_LOOP void _STLP_CALL +__advance(_InputIter& __i, _Distance __n, const output_iterator_tag &) { while (__n--) ++__i; } -# if defined (_STLP_NONTEMPL_BASE_MATCH_BUG) +#if defined (_STLP_NONTEMPL_BASE_MATCH_BUG) template -_STLP_INLINE_LOOP void _STLP_CALL __advance(_ForwardIterator& i, _Distance n, const forward_iterator_tag &) { - while (n--) ++i; +_STLP_INLINE_LOOP void _STLP_CALL +__advance(_ForwardIterator& i, _Distance n, const forward_iterator_tag &) { + while (n--) ++i; } -# endif +#endif template -_STLP_INLINE_LOOP void _STLP_CALL __advance(_BidirectionalIterator& __i, _Distance __n, - const bidirectional_iterator_tag &) { +_STLP_INLINE_LOOP void _STLP_CALL +__advance(_BidirectionalIterator& __i, _Distance __n, + const bidirectional_iterator_tag &) { if (__n > 0) while (__n--) ++__i; else @@ -439,8 +516,9 @@ } template -inline void _STLP_CALL __advance(_RandomAccessIterator& __i, _Distance __n, - const random_access_iterator_tag &) { +inline void _STLP_CALL +__advance(_RandomAccessIterator& __i, _Distance __n, + const random_access_iterator_tag &) { __i += __n; } @@ -451,9 +529,9 @@ _STLP_END_NAMESPACE -# if defined (_STLP_DEBUG) && ! defined (_STLP_DEBUG_H) +#if defined (_STLP_DEBUG) && !defined (_STLP_DEBUG_H) # include -# endif +#endif #endif /* _STLP_INTERNAL_ITERATOR_BASE_H */