]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed using arrays as nested classes
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 11 Jul 2003 19:33:10 +0000 (19:33 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 11 Jul 2003 19:33:10 +0000 (19:33 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21896 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/dynarray.h

index b022b49a9cb978df0052942871e91700f2353a02..3228aee579c9f13b9f7c0bc5152be7aa290f73f0 100644 (file)
@@ -350,10 +350,16 @@ public:                                                               \
     typedef value_type& reference;                                    \
     typedef value_type* pointer;                                      \
     typedef reverse_iterator itor;                                    \
-    friend itor operator+(int o, const itor& it);                     \
-    friend itor operator+(const itor& it, int o);                     \
-    friend itor operator-(const itor& it, int o);                     \
-    friend difference_type operator -(const itor& i1, const itor& i2);\
+    friend inline itor operator+(int o, const itor& it)               \
+        { return it.m_ptr - o; }                                      \
+    friend inline itor operator+(const itor& it, int o)               \
+        { return it.m_ptr - o; }                                      \
+    friend inline itor operator-(const itor& it, int o)               \
+        { return it.m_ptr + o; }                                      \
+    friend inline difference_type operator-(const itor& i1,           \
+                                            const itor& i2)           \
+        { return i1.m_ptr - i2.m_ptr; }                               \
+                                                                      \
   public:                                                             \
     pointer m_ptr;                                                    \
     reverse_iterator() : m_ptr(NULL) { }                              \
@@ -376,10 +382,16 @@ public:                                                               \
     typedef const value_type& reference;                              \
     typedef const value_type* pointer;                                \
     typedef const_reverse_iterator itor;                              \
-    friend itor operator+(int o, const itor& it);                     \
-    friend itor operator+(const itor& it, int o);                     \
-    friend itor operator-(const itor& it, int o);                     \
-    friend difference_type operator -(const itor& i1, const itor& i2);\
+    friend inline itor operator+(int o, const itor& it)               \
+        { return it.m_ptr - o; }                                      \
+    friend inline itor operator+(const itor& it, int o)               \
+        { return it.m_ptr - o; }                                      \
+    friend inline itor operator-(const itor& it, int o)               \
+        { return it.m_ptr + o; }                                      \
+    friend inline difference_type operator-(const itor& i1,           \
+                                            const itor& i2)           \
+        { return i1.m_ptr - i2.m_ptr; }                               \
+                                                                      \
   public:                                                             \
     pointer m_ptr;                                                    \
     const_reverse_iterator() : m_ptr(NULL) { }                        \
@@ -434,21 +446,8 @@ public:                                                               \
   void reserve(size_type n) { base::reserve(n); };                    \
   void resize(size_type n, value_type v = value_type());              \
   size_type size() const { return base::size(); }                     \
-};                                                                    \
-                                                                      \
-inline name::reverse_iterator operator+(int o, const name::reverse_iterator& it) { return it.m_ptr - o; } \
-inline name::reverse_iterator operator+(const name::reverse_iterator& it, int o) { return it.m_ptr - o; } \
-inline name::reverse_iterator operator-(const name::reverse_iterator& it, int o) { return it.m_ptr + o; } \
-inline name::difference_type operator -(const name::reverse_iterator& i1, \
-                             const name::reverse_iterator& i2)            \
-    { return i1.m_ptr - i2.m_ptr; }                                       \
-                                                                      \
-inline name::const_reverse_iterator operator+(int o, const name::const_reverse_iterator& it) { return it.m_ptr - o; } \
-inline name::const_reverse_iterator operator+(const name::const_reverse_iterator& it, int o) { return it.m_ptr - o; } \
-inline name::const_reverse_iterator operator-(const name::const_reverse_iterator& it, int o) { return it.m_ptr + o; } \
-inline name::difference_type operator -(const name::const_reverse_iterator& i1,\
-                             const name::const_reverse_iterator& i2)      \
-    { return i1.m_ptr - i2.m_ptr; }                                       \
+}
+
 
 #endif // !wxUSE_STL