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

Unified Diff: base/optional.h

Issue 2066053002: Fix AlignedMemory initialization in base/optional.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Fix windows Created 4 years, 6 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/optional.h
diff --git a/base/optional.h b/base/optional.h
index 988767cfe32cf4916bf5aa3272ebd271f1dc73c1..b468964ae339fbead38f769dd315ff39a008d054 100644
--- a/base/optional.h
+++ b/base/optional.h
@@ -240,20 +240,20 @@ class Optional {
private:
void Init(const T& value) {
DCHECK(storage_.is_null_);
- new (storage_.buffer_.template data_as<T>()) T(value);
+ new (storage_.buffer_.void_data()) T(value);
krasin 2016/06/15 06:24:13 Right. Before new is called, storage_buffer contai
ortuno 2016/06/15 14:32:27 Thanks for the explanation!
storage_.is_null_ = false;
}
void Init(T&& value) {
DCHECK(storage_.is_null_);
- new (storage_.buffer_.template data_as<T>()) T(std::move(value));
+ new (storage_.buffer_.void_data()) T(std::move(value));
storage_.is_null_ = false;
}
template <class... Args>
void Init(Args&&... args) {
DCHECK(storage_.is_null_);
- new (storage_.buffer_.template data_as<T>()) T(std::forward<Args>(args)...);
+ new (storage_.buffer_.void_data()) T(std::forward<Args>(args)...);
storage_.is_null_ = false;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698