The C++ standard library which was shipped with VC6, back in the dark ages, is pre-standardization version of the library.
The code you've posted is coded to work with the new version of the library, as you can see by coparing the old and new versions of iterator_traits:
iterator_traits (Visual Sudio 6.0)
http://msdn.microsoft.com/en-gb/library/aa262866%28v=vs.60%29.aspx
1 2 3 4 5 6
|
template<class It>
struct iterator_traits {
typedef It::iterator_category iterator_category;
typedef It::value_type value_type;
typedef It::distance_type distance_type;
};
|
iterator_traits Struct (Visual Studio 2010)
http://msdn.microsoft.com/en-us/library/vstudio/zdxb97eh%28v=vs.100%29.aspx
1 2 3 4 5 6 7 8 9 10 11
|
template<class Iterator>
struct iterator_traits {
typedef typename Iterator::iterator_category iterator_category;
typedef typename Iterator::value_type value_type;
typedef typename Iterator::difference_type difference_type;
typedef difference_type distance_type;
typedef typename Iterator::pointer pointer;
typedef typename Iterator::reference reference;
};
// plus two other variants
|
Basically, you need to repair the code which is trying to use those identifiers which only exist in the newer version of the standard library classes.
Or you could switch to using STLPort rather than the library which came with VC6...
Back in the days when I last worked with VC6, we used STLPort instead, as it's more standard conformant. Not sure if it's pot ot, but the iterator_traits from STLport 5.2.1 (which can be used with VC6) does have a difference_type member!
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
template <class _Iterator>
struct iterator_traits {
typedef typename _Iterator::iterator_category _OriginalTag;
typedef typename _CategoryMapping<_OriginalTag>::_Tag iterator_category;
#else
template <class _Iterator>
struct iterator_traits {
typedef typename _Iterator::iterator_category iterator_category;
#endif
typedef typename _Iterator::value_type value_type;
typedef typename _Iterator::difference_type difference_type;
typedef typename _Iterator::pointer pointer;
typedef typename _Iterator::reference reference;
};
|
Worth considering, especially if you are unlucky enough to have to use Visual Studio 6.0 for more than short while or have a lot of code that needs to be repaired to work with VC6 otherwise.
Andy
STLport
http://stlport.sourceforge.net/
http://sourceforge.net/projects/stlport/
How to Use STLPort with Visual C++
http://www.johnpanzer.com/UsingSTLPort.html