]> git.saurik.com Git - wxWidgets.git/commitdiff
Added operator[] (read-only of course). Borland C++ 4.52 wasn't smart
authorOve Kaaven <ovek@arcticnet.no>
Thu, 22 Apr 1999 00:31:06 +0000 (00:31 +0000)
committerOve Kaaven <ovek@arcticnet.no>
Thu, 22 Apr 1999 00:31:06 +0000 (00:31 +0000)
enough to automatically convert to a pointer for array indexing.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2258 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/buffer.h

index 67d23526d62eab381b6226350f254ecd717e7904..afc077699482ea45ad6b246cfda58893dabc9533 100644 (file)
@@ -54,6 +54,7 @@ public:
    }
 
    operator const char *() const { return m_str; }
+   char operator[](size_t n) const { return m_str[n]; }
 
 private:
    char *m_str;
@@ -98,7 +99,8 @@ public:
    }
 
    operator const wchar_t *() const { return m_wcs; }
-
+   wchar_t operator[](size_t n) const { return m_wcs[n]; }
+          
 private:
    wchar_t *m_wcs;
 };