changed iterator to use iterator_traits directly instead of
std::iterator to support the old STL on grace.
This commit is contained in:
parent
793c968f00
commit
3a80df28dd
|
@ -7,6 +7,18 @@
|
||||||
#include <iosfwd>
|
#include <iosfwd>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
|
class CConfig;
|
||||||
|
|
||||||
|
namespace std {
|
||||||
|
struct iterator_traits<CConfig> {
|
||||||
|
typedef CString value_type;
|
||||||
|
typedef ptrdiff_t difference_type;
|
||||||
|
typedef bidirectional_iterator_tag iterator_category;
|
||||||
|
typedef CString* pointer;
|
||||||
|
typedef CString& reference;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
class CConfig {
|
class CConfig {
|
||||||
public:
|
public:
|
||||||
enum EDirection { kLeft, kRight, kTop, kBottom,
|
enum EDirection { kLeft, kRight, kTop, kBottom,
|
||||||
|
@ -22,9 +34,7 @@ private:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef CCellMap::const_iterator internal_const_iterator;
|
typedef CCellMap::const_iterator internal_const_iterator;
|
||||||
class const_iterator : public std::iterator<
|
class const_iterator : std::iterator_traits<CConfig> {
|
||||||
std::bidirectional_iterator_tag,
|
|
||||||
CString, ptrdiff_t, CString*, CString&> {
|
|
||||||
public:
|
public:
|
||||||
explicit const_iterator() : m_i() { }
|
explicit const_iterator() : m_i() { }
|
||||||
explicit const_iterator(const internal_const_iterator& i) : m_i(i) { }
|
explicit const_iterator(const internal_const_iterator& i) : m_i(i) { }
|
||||||
|
|
Loading…
Reference in New Issue