This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project. See the libstdc++ home page for more information.
In my previous message I used four template paramters
for the iterator classes. I think we need only one parameter.
BTW. Should the class iterator (not const_iterator)
have `const' member functions? I think it shouldn't.
We could use the following srtucture for the iterators:
// bits/iter_base.h <-- new file
template<typename _Tp>
class _Iterator_base : public iterator<random_access_iterator_tag,
_Tp, ptfrdiff_t, _Tp*, _Tp&>
{
// members
};
template<typename _Tp>
class _Iterator : public _Iterator_base<_Tp>
{
// members
};
template<typename _Tp>
class _Const_iterator : public _Iterator_base<_Tp>
{
// members
};
// bits/basic_string.h
template<class _CharT, class _Traits, class _Alloc>
class basic_string {
public:
class iterator : public _Iterator<_CharT> {
friend class basic_string<_CharT, _Traits, _Alloc>;
// Constructors
};
class const_iterator : public _Const_iterator<_CharT> {
// like above
};
};
// stl/bits/stl_vector.h
template<class _Tp, class _Alloc>
class vector {
// iterators like in basic_string
};
Ryszard Kabatek
--
Martin-Luther University Halle-Wittenberg
Department of Physical Chemistry
Geusaer Str. 88, 06217 Merseburg, Germany
Tel. +49 3461 46 2487 Fax. +49 3461 46 2129