Revert of Remove user-defined move constructor and assignment operator from...

Revert of Remove user-defined move constructor and assignment operator from WTF::String (https://codereview.chromium.org/367343003/)

Reason for revert:
This can be applied only when user-defined dtor is removed.

Original issue's description:
> Remove user-defined move constructor and assignment operator from WTF::String
> 
> WTF::String can rely on implicit move constructor and assignment
> operator as WTF::RefPtr class has them defined now (r177066).
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=178541

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/402163002

git-svn-id: svn://svn.chromium.org/blink/trunk@178561 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 266aab48
...@@ -123,6 +123,15 @@ public: ...@@ -123,6 +123,15 @@ public:
String(StringImpl* impl) : m_impl(impl) { } String(StringImpl* impl) : m_impl(impl) { }
String(PassRefPtr<StringImpl> impl) : m_impl(impl) { } String(PassRefPtr<StringImpl> impl) : m_impl(impl) { }
#if COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES)
// We have to declare the copy constructor and copy assignment operator as well, otherwise
// they'll be implicitly deleted by adding the move constructor and move assignment operator.
String(const String& other) : m_impl(other.m_impl) { }
String(String&& other) : m_impl(other.m_impl.release()) { }
String& operator=(const String& other) { m_impl = other.m_impl; return *this; }
String& operator=(String&& other) { m_impl = other.m_impl.release(); return *this; }
#endif
// Inline the destructor. // Inline the destructor.
ALWAYS_INLINE ~String() { } ALWAYS_INLINE ~String() { }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment