From 38d56dddf1d5e13b897c4b222205d2d4a8069b01 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 19 Jan 2018 23:49:50 +0100 Subject: [PATCH] lib/icu/Compare: allow copying --- src/lib/icu/Compare.hxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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;