From c7f5eac10cdb99c46ca1c40e187820578814765d Mon Sep 17 00:00:00 2001 From: JustinAJ Date: Mon, 2 Jun 2014 14:55:00 -0400 Subject: [PATCH] Moved access operator. Made access operator const. --- Jupiter/Readable_String.h | 3 +++ Jupiter/String_Type.h | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Jupiter/Readable_String.h b/Jupiter/Readable_String.h index 83c7485..104c7e0 100644 --- a/Jupiter/Readable_String.h +++ b/Jupiter/Readable_String.h @@ -173,6 +173,9 @@ namespace Jupiter */ size_t println(FILE *out) const; size_t println(std::basic_ostream &out) const; + + /** Access operator */ + inline T &operator[](size_t index) const { return this->get(index); }; }; } diff --git a/Jupiter/String_Type.h b/Jupiter/String_Type.h index 7e6e84e..a8a5a6b 100644 --- a/Jupiter/String_Type.h +++ b/Jupiter/String_Type.h @@ -184,9 +184,6 @@ namespace Jupiter template class R> static R gotoWord(const Jupiter::String_Type &in, size_t pos, const T *whitespace); template class R> static R gotoWord(const T *in, size_t pos, const T *whitespace); - /** Access operator */ - inline T &operator[](size_t index) { return Jupiter::String_Type::get(index); }; - /** Mutative operators */ inline String_Type &operator+=(const String_Type &right) { this->concat(right); return *this; }; inline String_Type &operator+=(const std::basic_string &right) { this->concat(right); return *this; };