From 7a1b2faff7fb89fe1a4d58a35a8d406bb4e61421 Mon Sep 17 00:00:00 2001 From: "Ben \"root\" Anderson" Date: Fri, 25 Oct 2013 02:32:46 -0500 Subject: [PATCH] Revert "the const CT& stuff confuses GCC" This reverts commit 082a9723af6f3f8ce5b850430d7f4f1d66d79623. --- src/StdString.h | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/src/StdString.h b/src/StdString.h index b23cc797bb..43c23b9c61 100644 --- a/src/StdString.h +++ b/src/StdString.h @@ -742,12 +742,35 @@ public: // Array-indexing operators. Required because we defined an implicit cast // to operator const CT* (Thanks to Julian Selman for pointing this out) - CT& operator[](long long int nIdx) + CT& operator[](int nIdx) { return MYBASE::operator[](static_cast(nIdx)); } + + const CT& operator[](int nIdx) const + { + return MYBASE::operator[](static_cast(nIdx)); + } + + CT& operator[](unsigned int nIdx) + { + return MYBASE::operator[](static_cast(nIdx)); + } + + const CT& operator[](unsigned int nIdx) const + { + return MYBASE::operator[](static_cast(nIdx)); + } + + CT& operator[](long unsigned int nIdx){ + return MYBASE::operator[](static_cast(nIdx)); + } + + const CT& operator[](long unsigned int nIdx) const { + return MYBASE::operator[](static_cast(nIdx)); + } - CT& operator[](long long unsigned int nIdx){ + const CT& operator[](long long unsigned int nIdx) const { return MYBASE::operator[](static_cast(nIdx)); } #ifndef SS_NO_IMPLICIT_CASTS