Index: webrtc/base/optional.h |
diff --git a/webrtc/base/optional.h b/webrtc/base/optional.h |
index 4d2b44e0cb62ed4d3f6cbf91c8f2649ba73c7a28..31bf1afb29fb4b5c848ce8df95622846a13e4726 100644 |
--- a/webrtc/base/optional.h |
+++ b/webrtc/base/optional.h |
@@ -239,6 +239,12 @@ class Optional final { |
: default_val; |
} |
+ // Dereference and move value. |
+ T ConsumeValue() { |
+ RTC_DCHECK(has_value_); |
+ return std::move(value_); |
+ } |
+ |
// Equality tests. Two Optionals are equal if they contain equivalent values, |
// or if they're both empty. |
friend bool operator==(const Optional& m1, const Optional& m2) { |