diff options
author | Yuqian Yang <crupest@crupest.life> | 2025-09-08 23:08:10 +0800 |
---|---|---|
committer | Yuqian Yang <crupest@crupest.life> | 2025-09-08 23:08:10 +0800 |
commit | 37d9a034013b4245a50c0d748dc83d2c3d136210 (patch) | |
tree | 3cee1be334acc4d917e9d6b3cbe3e03b653116ac /include/cru/base/String.h | |
parent | 0b0c32a1d688389c36f1847edf77af1fd7a2f9d7 (diff) | |
download | cru-37d9a034013b4245a50c0d748dc83d2c3d136210.tar.gz cru-37d9a034013b4245a50c0d748dc83d2c3d136210.tar.bz2 cru-37d9a034013b4245a50c0d748dc83d2c3d136210.zip |
Fix windows dynamic lib build.
Diffstat (limited to 'include/cru/base/String.h')
-rw-r--r-- | include/cru/base/String.h | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/include/cru/base/String.h b/include/cru/base/String.h index e58f21d3..7d462a6e 100644 --- a/include/cru/base/String.h +++ b/include/cru/base/String.h @@ -65,7 +65,7 @@ class CRU_BASE_API String { #endif public: - String() = default; + String(); String(const_pointer str); String(const_pointer str, size_type size); @@ -75,7 +75,7 @@ class CRU_BASE_API String { : String(reinterpret_cast<const_pointer>(str), size - 1) {} template <typename Iter> - String(Iter start, Iter end) { + String(Iter start, Iter end): String() { for (; start != end; start++) { append(*start); } @@ -250,12 +250,9 @@ class CRU_BASE_API String { } private: - static char16_t kEmptyBuffer[1]; - - private: - char16_t* buffer_ = kEmptyBuffer; - Index size_ = 0; // not including trailing '\0' - Index capacity_ = 0; // always 1 smaller than real buffer size + char16_t* buffer_; + Index size_; // not including trailing '\0' + Index capacity_; // always 1 smaller than real buffer size }; CRU_BASE_API std::ostream& operator<<(std::ostream& os, const String& value); |