Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1274)

Unified Diff: third_party/inspector_protocol/lib/Maybe_h.template

Issue 2469063002: Roll third_party/inspector_protocol to cf45a6e89b17cdc9eeacdef4c003fcc55f7ec2a0 (Closed)
Patch Set: rebased test Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/inspector_protocol/lib/Maybe_h.template
diff --git a/third_party/inspector_protocol/lib/Maybe_h.template b/third_party/inspector_protocol/lib/Maybe_h.template
index 2096572ba7ba60a803638aa8aceb2a0e72d88fc6..cd0dfbdf2e10c9e3b52ec0ba7baccf3744481ba9 100644
--- a/third_party/inspector_protocol/lib/Maybe_h.template
+++ b/third_party/inspector_protocol/lib/Maybe_h.template
@@ -16,6 +16,7 @@ class Maybe {
public:
Maybe() : m_value() { }
Maybe(std::unique_ptr<T> value) : m_value(std::move(value)) { }
+ Maybe(Maybe&& other) : m_value(std::move(other.m_value)) { }
void operator=(std::unique_ptr<T> value) { m_value = std::move(value); }
T* fromJust() const { DCHECK(m_value); return m_value.get(); }
T* fromMaybe(T* defaultValue) const { return m_value ? m_value.get() : defaultValue; }
@@ -30,6 +31,7 @@ class MaybeBase {
public:
MaybeBase() : m_isJust(false) { }
MaybeBase(T value) : m_isJust(true), m_value(value) { }
+ MaybeBase(MaybeBase&& other) : m_isJust(other.m_isJust), m_value(std::move(other.m_value)) { }
void operator=(T value) { m_value = value; m_isJust = true; }
T fromJust() const { DCHECK(m_isJust); return m_value; }
T fromMaybe(const T& defaultValue) const { return m_isJust ? m_value : defaultValue; }
@@ -46,6 +48,7 @@ class Maybe<bool> : public MaybeBase<bool> {
public:
Maybe() { }
Maybe(bool value) : MaybeBase(value) { }
+ Maybe(Maybe&& other) : MaybeBase(std::move(other)) { }
using MaybeBase::operator=;
};
@@ -54,6 +57,7 @@ class Maybe<int> : public MaybeBase<int> {
public:
Maybe() { }
Maybe(int value) : MaybeBase(value) { }
+ Maybe(Maybe&& other) : MaybeBase(std::move(other)) { }
using MaybeBase::operator=;
};
@@ -62,6 +66,7 @@ class Maybe<double> : public MaybeBase<double> {
public:
Maybe() { }
Maybe(double value) : MaybeBase(value) { }
+ Maybe(Maybe&& other) : MaybeBase(std::move(other)) { }
using MaybeBase::operator=;
};
@@ -70,6 +75,7 @@ class Maybe<String> : public MaybeBase<String> {
public:
Maybe() { }
Maybe(const String& value) : MaybeBase(value) { }
+ Maybe(Maybe&& other) : MaybeBase(std::move(other)) { }
using MaybeBase::operator=;
};

Powered by Google App Engine
This is Rietveld 408576698