From 70b9218839cc27c76dce95e5c688e91f6d7d203f Mon Sep 17 00:00:00 2001 From: roker Date: Fri, 8 Oct 2021 12:52:43 +0200 Subject: [PATCH] Oops... default c'tor forgotten. And some trivial assignment operators as alias to .assign(). --- src/nfc.hh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/nfc.hh b/src/nfc.hh index c5774ab..40ec38e 100644 --- a/src/nfc.hh +++ b/src/nfc.hh @@ -98,7 +98,6 @@ public: static const size_t npos = String::npos; - explicit nfc_string(StringView src); explicit nfc_string(String && src); @@ -111,6 +110,7 @@ public: : nfc_string{ StringView{src, length} } {} + nfc_string() = default; nfc_string(const nfc_string& src) = default; nfc_string( nfc_string&& src) = default; @@ -119,7 +119,11 @@ public: nfc_string& assign(StringView src); nfc_string& assign(String && src); + nfc_string& assign(const CharT* src) { return this->assign(StringView{src}); } + nfc_string& operator=(StringView src) { return this->assign(src); } + nfc_string& operator=(String && src) { return this->assign(std::move(src)); } + nfc_string& operator=(const CharT* src) { return this->assign(StringView{src}); } /// read-only: shares representation operator const String&() const noexcept { return s; }