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

Unified Diff: include/core/SkTLazy.h

Issue 2271743002: Reland: Experimental parsing expression grammar (PEG) template library (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: SkTLazy initializer fix Created 4 years, 4 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
Index: include/core/SkTLazy.h
diff --git a/include/core/SkTLazy.h b/include/core/SkTLazy.h
index 31dce6085f96779c3137fc5bf4011766a91b31f4..8dbc3f6552dbbf5c5d2577ee62837b29eb3d9abb 100644
--- a/include/core/SkTLazy.h
+++ b/include/core/SkTLazy.h
@@ -21,8 +21,10 @@ template <typename T> class SkTLazy {
public:
SkTLazy() : fPtr(nullptr) {}
- explicit SkTLazy(const T* src)
- : fPtr(src ? new (fStorage.get()) T(*src) : nullptr) {}
+ explicit SkTLazy(const T* src) {
+ // Not in initializer list because it depends on fStorage.
mtklein 2016/08/24 01:19:28 Alternatively, swap the order of the member variab
f(malita) 2016/08/24 13:47:29 Done.
+ fPtr = src ? new (fStorage.get()) T(*src) : nullptr;
+ }
SkTLazy(const SkTLazy& src) : fPtr(nullptr) { *this = src; }

Powered by Google App Engine
This is Rietveld 408576698