From 37d9a034013b4245a50c0d748dc83d2c3d136210 Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Mon, 8 Sep 2025 23:08:10 +0800 Subject: Fix windows dynamic lib build. --- include/cru/base/String.h | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'include/cru/base/String.h') 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(str), size - 1) {} template - 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); -- cgit v1.2.3