Commit 025341c6 authored by Daniel Cheng's avatar Daniel Cheng Committed by Commit Bot

Add explicit {copy,move} {ctor,assignment operator} to WTF::String

Change-Id: I28260c2656d1494c9bfb690f8486eacbeb44a53a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2296638
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarDominic Farolino <dom@chromium.org>
Reviewed-by: default avatarJeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#810795}
parent 645de815
...@@ -103,6 +103,14 @@ class WTF_EXPORT String { ...@@ -103,6 +103,14 @@ class WTF_EXPORT String {
String(StringImpl* impl) : impl_(impl) {} String(StringImpl* impl) : impl_(impl) {}
String(scoped_refptr<StringImpl> impl) : impl_(std::move(impl)) {} String(scoped_refptr<StringImpl> impl) : impl_(std::move(impl)) {}
// Copying a String is a relatively inexpensive, since the underlying data is
// immutable and refcounted.
String(const String&) = default;
String& operator=(const String&) = default;
String(String&&) noexcept = default;
String& operator=(String&&) = default;
void swap(String& o) { impl_.swap(o.impl_); } void swap(String& o) { impl_.swap(o.impl_); }
template <typename CharType> template <typename CharType>
......
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