diff options
Diffstat (limited to 'fixedstring.h')
-rw-r--r-- | fixedstring.h | 9 |
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) { |