From 89bd99bed85083c736390f3e340fd30be350d461 Mon Sep 17 00:00:00 2001 From: halcanary Date: Wed, 2 Mar 2016 08:21:39 -0800 Subject: [PATCH] sk_sp: remove explicit operator bool() GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1757593005 Review URL: https://codereview.chromium.org/1757593005 --- include/core/SkRefCnt.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/core/SkRefCnt.h b/include/core/SkRefCnt.h index 02df993261..cea72cda66 100644 --- a/include/core/SkRefCnt.h +++ b/include/core/SkRefCnt.h @@ -316,7 +316,11 @@ public: template bool operator!=(const sk_sp& that) const { return this->get() != that.get(); } - explicit operator bool() const { return this->get() != nullptr; } + // MSVC 2013 does not work correctly with explicit operator bool. + // https://chromium-cpp.appspot.com/#core-blacklist + //explicit operator bool() const { return this->get() != nullptr; } + + bool operator!() const { return this->get() == nullptr; } T* get() const { return fPtr; } T* operator->() const { return fPtr; }