aboutsummaryrefslogtreecommitdiff
path: root/src/common/String.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-01-12 21:35:08 +0800
committercrupest <crupest@outlook.com>2022-01-12 21:35:08 +0800
commit7a42d92c10a4bc686244668dd0e3f903f30f2fae (patch)
treee48fc4a47afa5eadbdf54cec6d2b73110f500680 /src/common/String.cpp
parent882d843083895f4905571dc273e801ee18fd5984 (diff)
downloadcru-7a42d92c10a4bc686244668dd0e3f903f30f2fae.tar.gz
cru-7a42d92c10a4bc686244668dd0e3f903f30f2fae.tar.bz2
cru-7a42d92c10a4bc686244668dd0e3f903f30f2fae.zip
...
Diffstat (limited to 'src/common/String.cpp')
-rw-r--r--src/common/String.cpp7
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()) {}