summaryrefslogtreecommitdiff
path: root/fixedstring.h
diff options
context:
space:
mode:
authorJohn Fultz <jfultz@wolfram.com>2019-03-19 11:16:43 -0500
committerJohn Fultz <jfultz@wolfram.com>2019-07-21 02:02:55 -0700
commite7f645d4f5030e52b1c9f27dc3fbf2c20fd47cd5 (patch)
tree9e0d59f8b491091cfa36931982d8a96c599f5106 /fixedstring.h
parent4cd51c4a7233dd4334832cc05bfaa91221d98916 (diff)
Move constructor for FixedLengthString.
Diffstat (limited to 'fixedstring.h')
-rw-r--r--fixedstring.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/fixedstring.h b/fixedstring.h
index cda0cf4..8c9c0da 100644
--- a/fixedstring.h
+++ b/fixedstring.h
@@ -42,6 +42,7 @@ class FixedLengthString
FixedLengthString(size_type n, char c);
FixedLengthString(const char* s);
FixedLengthString(const FixedLengthString& s);
+ FixedLengthString(FixedLengthString&& s);
const_iterator begin() const;
const_iterator end() const;
@@ -139,6 +140,14 @@ FixedLengthString::FixedLengthString(const FixedLengthString& s)
m_end = m_data + sz;
}
+inline
+FixedLengthString::FixedLengthString(FixedLengthString&& s)
+{
+ int sz = s.size();
+ memcpy(m_data, s.m_data, sz);
+ m_end = m_data + sz;
+}
+
inline FixedLengthString &
FixedLengthString::operator=(const FixedLengthString &s)
{