diff options
| author | Maxime Coste <mawww@kakoune.org> | 2021-07-09 17:03:22 +1000 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2021-07-09 17:03:22 +1000 |
| commit | c30a0e0ca27aa93db65fb9d2399a596eeb610b6d (patch) | |
| tree | cfeff974d2b9cfc8fa539f523170b6f0c87ee3af /src/string.hh | |
| parent | 2289f350df1b957f0fbd60ecc941a87d4d7b4b44 (diff) | |
Inline String::Data no-copy constructor
Diffstat (limited to 'src/string.hh')
| -rw-r--r-- | src/string.hh | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/string.hh b/src/string.hh index 56771c65..1a3568e0 100644 --- a/src/string.hh +++ b/src/string.hh @@ -178,7 +178,8 @@ public: } s; Data() { set_empty(); } - Data(NoCopy, const char* data, size_t size); + Data(NoCopy, const char* data, size_t size) : l{const_cast<char*>(data), size, 0} {} + Data(const char* data, size_t size, size_t capacity); Data(const char* data, size_t size) : Data(data, size, size) {} Data(const Data& other) : Data{other.data(), other.size()} {} |
