]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - wtf/OwnArrayPtr.h
JavaScriptCore-721.26.tar.gz
[apple/javascriptcore.git] / wtf / OwnArrayPtr.h
index 2b6c7dc6901e524ed00009ca7e8afb9459e52176..61375c7691c163eaeb7b6415b1b23de97a70d665 100644 (file)
@@ -1,4 +1,3 @@
-// -*- mode: c++; c-basic-offset: 4 -*-
 /*
  *  Copyright (C) 2006 Apple Computer, Inc.
  *
@@ -28,7 +27,7 @@
 
 namespace WTF {
 
-    template <typename T> class OwnArrayPtr : Noncopyable {
+    template <typename T> class OwnArrayPtr : public Noncopyable {
     public:
         explicit OwnArrayPtr(T* ptr = 0) : m_ptr(ptr) { }
         ~OwnArrayPtr() { safeDelete(); }
@@ -47,8 +46,12 @@ namespace WTF {
         bool operator!() const { return !m_ptr; }
 
         // This conversion operator allows implicit conversion to bool but not to other integer types.
+#if COMPILER(WINSCW)
+        operator bool() const { return m_ptr; }
+#else
         typedef T* OwnArrayPtr::*UnspecifiedBoolType;
         operator UnspecifiedBoolType() const { return m_ptr ? &OwnArrayPtr::m_ptr : 0; }
+#endif
 
         void swap(OwnArrayPtr& o) { std::swap(m_ptr, o.m_ptr); }