最終更新日時(UTC): 2017年11月27日 05時01分15秒 Akira Takahashi が更新
履歴 編集
void clear() noexcept;
全ての要素を削除する。
erase(begin(), end());と同じ。
erase(begin(), end());
なし
投げない
#include <cassert> #include <string> int main() { std::string s = "hello"; // 文字列を空にする s.clear(); assert(s.empty()); }