aboutsummaryrefslogtreecommitdiff
path: root/include/string
diff options
context:
space:
mode:
Diffstat (limited to 'include/string')
-rw-r--r--include/string12
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);