]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/stringimpl.h
derive wxStaticText from wxStaticTextBase under wxGTK1 too, in particular thi sfixes...
[wxWidgets.git] / include / wx / stringimpl.h
index be477a3275a6ec86e9bc2471b400105369d50a6c..b680b52cf1a03ff9c317939107eb4c95b04d9fe0 100644 (file)
@@ -184,6 +184,7 @@ public:
         typedef wxStringCharType value_type;                                  \
         typedef ref_type reference;                                           \
         typedef ptr_type pointer;                                             \
+        typedef int difference_type;                                          \
                                                                               \
         iterator_name(pointer ptr) : m_ptr(ptr) { }                           \
                                                                               \
@@ -207,14 +208,22 @@ public:
                                                                               \
         iterator_name operator+(int n) const                                  \
             { return iterator_name(m_ptr + n); }                              \
+        iterator_name operator+(size_t n) const                               \
+            { return iterator_name(m_ptr + n); }                              \
         iterator_name operator-(int n) const                                  \
             { return iterator_name(m_ptr - n); }                              \
+        iterator_name operator-(size_t n) const                               \
+            { return iterator_name(m_ptr - n); }                              \
         iterator_name& operator+=(int n)                                      \
             { m_ptr += n; return *this; }                                     \
+        iterator_name& operator+=(size_t n)                                   \
+            { m_ptr += n; return *this; }                                     \
         iterator_name& operator-=(int n)                                      \
+            { m_ptr -= n; return *this; }                                     \
+        iterator_name& operator-=(size_t n)                                   \
             { m_ptr -= n; return *this; }                                     \
                                                                               \
-        size_t operator-(const iterator_name& i) const                        \
+        difference_type operator-(const iterator_name& i) const               \
             { return m_ptr - i.m_ptr; }                                       \
                                                                               \
         bool operator==(const iterator_name& i) const                         \
@@ -239,6 +248,11 @@ public:
                                                                               \
         pointer m_ptr
 
+  // we need to declare const_iterator in wxStringImpl scope, the friend
+  // declaration inside iterator class itself is not enough, or at least not
+  // for g++ 3.4 (g++ 4 is ok)
+  class const_iterator;
+
   class iterator
   {
     WX_DEFINE_STRINGIMPL_ITERATOR(iterator,
@@ -258,6 +272,8 @@ public:
                                     const wxStringCharType*);
   };
 
+  #undef WX_DEFINE_STRINGIMPL_ITERATOR
+
 
   // constructors and destructor
     // ctor for an empty string