diff options
Diffstat (limited to 'Source/JavaScriptCore/heap/Strong.h')
-rw-r--r-- | Source/JavaScriptCore/heap/Strong.h | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/Source/JavaScriptCore/heap/Strong.h b/Source/JavaScriptCore/heap/Strong.h index 27ab5d31f..264c24e25 100644 --- a/Source/JavaScriptCore/heap/Strong.h +++ b/Source/JavaScriptCore/heap/Strong.h @@ -23,8 +23,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef Strong_h -#define Strong_h +#pragma once #include <wtf/Assertions.h> #include "Handle.h" @@ -84,9 +83,7 @@ public: bool operator!() const { return !slot() || !*slot(); } - // This conversion operator allows implicit conversion to bool but not to other integer types. - typedef JSValue (HandleBase::*UnspecifiedBoolType); - operator UnspecifiedBoolType*() const { return !!*this ? reinterpret_cast<UnspecifiedBoolType*>(1) : 0; } + explicit operator bool() const { return !!*this; } void swap(Strong& other) { @@ -154,6 +151,4 @@ template<typename T> struct VectorTraits<JSC::Strong<T>> : SimpleClassVectorTrai template<typename P> struct HashTraits<JSC::Strong<P>> : SimpleClassHashTraits<JSC::Strong<P>> { }; -} - -#endif // Strong_h +} // namespace WTF |