Update of /cvsroot/cpptool/rfta/include/xtl
In directory sc8-pr-cvs1:/tmp/cvs-serv31419/include/xtl
Added Files:
IteratorTraits.h
Log Message:
* portability fixes: now compile & works on Sun CC 5.3 & AIX visual age.
--- NEW FILE: IteratorTraits.h ---
#ifndef XTL_ITERATORTRAITS_H_INCLUDED
#define XTL_ITERATORTRAITS_H_INCLUDED
#include <iterator>
// Rogue Wave library: does not define iterator_traits on sunpro cc 5.3
#if defined( __SUNPRO_CC )
# if defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER)
namespace std {
// Implementation below from rogue wave documentation provided with sunpro cc 5.3.
template <class Iterator> struct iterator_traits
{
typedef typename Iterator::value_type value_type;
typedef typename Iterator::difference_type
difference_type;
typedef typename Iterator::pointer pointer;
typedef typename Iterator::reference reference;
// line below does not work for std::map::iterator
// typedef typename Iterator::iterator_category
// iterator_category;
};
// Specialization
template <class T> struct iterator_traits<T*>
{
typedef T value_type;
typedef ptrdiff_t difference_type;
typedef T* pointer;
typedef T& reference;
typedef random_access_iterator_tag iterator_category;
};
} // namespace std
# endif
#endif
#endif // XTL_ITERATORTRAITS_H_INCLUDED
|