Difference between revisions of "cpp/string/basic string/clear"
From cppreference.com
< cpp | string | basic string
m (§ 21.4.4 of N3485) |
(use rev to mark the changes between standards) |
||
Line 14: | Line 14: | ||
===Exceptions=== | ===Exceptions=== | ||
− | {{noexcept}} | + | {{rev begin}} |
+ | {{rev | until=c++11 | (none) }} | ||
+ | {{rev | since=c++11 | {{noexcept}} }} | ||
+ | {{rev end}} | ||
===Complexity=== | ===Complexity=== |
Revision as of 03:54, 25 June 2013
void clear(); |
||
Removes all characters from the string. The allocated memory will not be released, effectively leaving the capacity of the string unchanged. The past-the-end iterators are not invalidated.
Contents |
Parameters
(none)
Return value
(none)
Exceptions
(none) | (until C++11) |
noexcept specification: noexcept |
(since C++11) |
Complexity
Linear in the size of the string.
See also
removes characters (public member function) |