diff options
author | Jean-Baptiste Queru <jbq@google.com> | 2009-11-15 12:05:41 -0800 |
---|---|---|
committer | Jean-Baptiste Queru <jbq@google.com> | 2009-11-15 12:05:41 -0800 |
commit | 992df477e264540d244af44dd49e0e2a481eaf97 (patch) | |
tree | 6cba51557eba418b540029ad96aeffe03859722a /include/string | |
parent | 9cb0478662a7c988146fff0d868bba2839ea80f2 (diff) | |
parent | 1ebb2f779283ea40603d9a60c0366c1cb59698a6 (diff) | |
download | astl-992df477e264540d244af44dd49e0e2a481eaf97.tar.gz |
merge from eclair
Diffstat (limited to 'include/string')
-rw-r--r-- | include/string | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/string b/include/string index 552c37b..f1cfe93 100644 --- a/include/string +++ b/include/string @@ -61,12 +61,17 @@ class string // Constructors string(); + string(const string& str); + // Construct a string from a source's substring. // @param str The source string. // @param pos The index of the character to start the copy at. // @param n The number of characters to copy. Use string::npos for the // remainder. - string(const string& str, size_t pos = 0, size_type n = npos); + string(const string& str, size_t pos, size_type n); + + // Same as above but implicitly copy from pos to the end of the str. + string(const string& str, size_type pos); // Construct a string from a C string. // @param str The source string, must be '\0' terminated. @@ -236,11 +241,6 @@ class string // starting position. size_type find(const value_type *str, size_type pos = 0) const; - // @return a substring of this one. - string substr(size_type pos = 0, size_type n = npos) const { - return string(*this, pos, n); - } - private: bool SafeMalloc(size_type n); void SafeRealloc(size_type n); |