diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2015-01-15 19:58:08 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2015-01-15 19:58:08 +0000 |
| commit | 4fd92127c3584b9e482613ecb78f1bd3cc93c1f1 (patch) | |
| tree | 85fa6303ad9ba5cf01fa785e6215188def843457 /src/shared_string.hh | |
| parent | bb915f0bc5bcb40f5de20f47cb2934597474a5da (diff) | |
Add a no copy shared string constructor, used for map lookup, and intern words
Diffstat (limited to 'src/shared_string.hh')
| -rw-r--r-- | src/shared_string.hh | 3 |
1 files changed, 3 insertions, 0 deletions
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 |
