diff options
author | crupest <crupest@outlook.com> | 2022-01-12 21:35:08 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-01-12 21:35:08 +0800 |
commit | 7a42d92c10a4bc686244668dd0e3f903f30f2fae (patch) | |
tree | e48fc4a47afa5eadbdf54cec6d2b73110f500680 /src/common/String.cpp | |
parent | 882d843083895f4905571dc273e801ee18fd5984 (diff) | |
download | cru-7a42d92c10a4bc686244668dd0e3f903f30f2fae.tar.gz cru-7a42d92c10a4bc686244668dd0e3f903f30f2fae.tar.bz2 cru-7a42d92c10a4bc686244668dd0e3f903f30f2fae.zip |
...
Diffstat (limited to 'src/common/String.cpp')
-rw-r--r-- | src/common/String.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/common/String.cpp b/src/common/String.cpp index ca16cee7..21f3f235 100644 --- a/src/common/String.cpp +++ b/src/common/String.cpp @@ -39,6 +39,13 @@ String::String(const_pointer str, Index size) { this->capacity_ = size; } +String::String(size_type size, value_type ch) : String() { + reserve(size); + for (Index i = 0; i < size; i++) { + append(ch); + } +} + String::String(std::initializer_list<char16_t> l) : String(l.begin(), l.size()) {} |