From 4fd92127c3584b9e482613ecb78f1bd3cc93c1f1 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 15 Jan 2015 19:58:08 +0000 Subject: Add a no copy shared string constructor, used for map lookup, and intern words --- src/shared_string.hh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/shared_string.hh') diff --git a/src/shared_string.hh b/src/shared_string.hh index 50eec956..982cb67f 100644 --- a/src/shared_string.hh +++ b/src/shared_string.hh @@ -24,6 +24,9 @@ public: StringView::operator=(*m_storage); } } + struct NoCopy{}; + SharedString(StringView str, NoCopy) : StringView(str) {} + SharedString(const char* str) : SharedString(StringView{str}) {} SharedString acquire_substr(ByteCount from, ByteCount length = INT_MAX) const -- cgit v1.2.3