File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ Examples:
2121.. code-block :: c++
2222
2323 std::string("test", 200); // Will include random characters after "test".
24+ std::string("test", 2, 5); // Will include random characters after "st".
2425 std::string_view("test", 200);
2526
2627Creating an empty string from constructors with parameters is considered
@@ -31,8 +32,19 @@ Examples:
3132.. code-block :: c++
3233
3334 std::string("test", 0); // Creation of an empty string.
35+ std::string("test", 1, 0);
3436 std::string_view("test", 0);
3537
38+ Passing an invalid first character position parameter to constructor will
39+ cause ``std::out_of_range `` exception at runtime.
40+
41+ Examples:
42+
43+ .. code-block :: c++
44+
45+ std::string("test", -1, 10); // Negative first character position.
46+ std::string("test", 10, 10); // First character position is bigger than string literal character range".
47+
3648Options
3749-------
3850
You can’t perform that action at this time.
0 commit comments