diff options
author | Max Kellermann <max@musicpd.org> | 2018-01-19 23:49:50 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2018-01-19 23:49:50 +0100 |
commit | 38d56dddf1d5e13b897c4b222205d2d4a8069b01 (patch) | |
tree | 4f671ffea669eaded6ec9c5df3a77f783c4f9b17 /src/lib/icu | |
parent | e8975942eca329727181f4b16077b5cf375fd8f8 (diff) |
lib/icu/Compare: allow copying
Diffstat (limited to 'src/lib/icu')
-rw-r--r-- | src/lib/icu/Compare.hxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/icu/Compare.hxx b/src/lib/icu/Compare.hxx index 9ee2e6848..d38026508 100644 --- a/src/lib/icu/Compare.hxx +++ b/src/lib/icu/Compare.hxx @@ -37,6 +37,18 @@ public: explicit IcuCompare(const char *needle) noexcept; + IcuCompare(const IcuCompare &src) noexcept + :needle(src + ? AllocatedString<>::Duplicate(src.needle.c_str()) + : nullptr) {} + + IcuCompare &operator=(const IcuCompare &src) noexcept { + needle = src + ? AllocatedString<>::Duplicate(src.needle.c_str()) + : nullptr; + return *this; + } + IcuCompare(IcuCompare &&) = default; IcuCompare &operator=(IcuCompare &&) = default; |