Skip to content

Commit 5c814aa

Browse files
committed
StaticString::clear
1 parent 6f7a4e9 commit 5c814aa

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

util/static_string.hh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ struct StaticString {
3434
_data[i] = '\0';
3535
}
3636

37+
constexpr void clear() {
38+
_data[0] = '\0';
39+
}
40+
3741
constexpr void copy(std::string_view s) {
3842
size_t i = 0;
3943
for (auto c : s) {

0 commit comments

Comments
 (0)