diff --git a/src/template.h b/src/template.h index e87d8d95..bf44267d 100644 --- a/src/template.h +++ b/src/template.h @@ -232,10 +232,6 @@ public: ImmutableString(const char *s, size_t slen) : len(slen), base(copystr(s, len)) {} ImmutableString(const char *s) : len(strlen(s)), base(copystr(s, len)) {} - ImmutableString(std::unique_ptr s) - : len(strlen(s.get())), base(len == 0 ? "" : s.release()) {} - ImmutableString(std::unique_ptr s, size_t slen) - : len(slen), base(len == 0 ? "" : s.release()) {} ImmutableString(const std::string &s) : len(s.size()), base(copystr(s.c_str(), s.size())) {} template diff --git a/src/template_test.cc b/src/template_test.cc index 6a1f0fc8..70050888 100644 --- a/src/template_test.cc +++ b/src/template_test.cc @@ -50,20 +50,16 @@ void test_template_immutable_string(void) { CU_ASSERT(std::string("alpha") == from_cstr); CU_ASSERT(from_cstr == std::string("alpha")); - ImmutableString from_uniq(strcopy("charlie")); - - CU_ASSERT("charlie" == from_uniq); - CU_ASSERT(7 == from_uniq.size()); - // copy constructor - ImmutableString copy = from_uniq; + ImmutableString src("charlie"); + ImmutableString copy = src; CU_ASSERT("charlie" == copy); CU_ASSERT(7 == copy.size()); // copy assignment ImmutableString copy2; - copy2 = from_uniq; + copy2 = src; CU_ASSERT("charlie" == copy2); CU_ASSERT(7 == copy2.size());