diff options
author | Nicolas Catania <niko@google.com> | 2010-01-28 16:48:34 -0800 |
---|---|---|
committer | Nicolas Catania <niko@google.com> | 2010-01-30 16:59:41 -0800 |
commit | 74a6fdea77d52a17be4bc38831fe02a31cefbf34 (patch) | |
tree | 4ee780faead236dddaa2d0eda7b3e5febbcac138 /include | |
parent | 2f8be091d59666a33e3fd11fca1ce71f0a90edbc (diff) | |
download | astl-74a6fdea77d52a17be4bc38831fe02a31cefbf34.tar.gz |
Added the 'at' method to string.
Diffstat (limited to 'include')
-rw-r--r-- | include/string | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/string b/include/string index 8e1ebbe..7c2f474 100644 --- a/include/string +++ b/include/string @@ -193,6 +193,10 @@ class string // @return a reference to the char. char& operator[](const size_type pos); + // 'at' is similar to operator[] except that it does check bounds. + const char& at(const size_type pos) const; + char& at(const size_type pos); + // Assignments. string& operator=(const string& str) { return assign(str); } string& operator=(const char* str) { return assign(str); } |