]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - wtf/VectorTraits.h
JavaScriptCore-576.tar.gz
[apple/javascriptcore.git] / wtf / VectorTraits.h
index 7974b9a77e7544d9dacc8ff6b1fd8d211fb49035..bf7787834d2a6c1e3c97abf41dfcec5fc5af59ac 100644 (file)
@@ -21,6 +21,7 @@
 #ifndef WTF_VectorTraits_h
 #define WTF_VectorTraits_h
 
+#include "OwnPtr.h"
 #include "RefPtr.h"
 #include "TypeTraits.h"
 #include <utility>
@@ -31,7 +32,7 @@ using std::pair;
 namespace WTF {
 
     template<bool isPod, typename T>
-    class VectorTraitsBase;
+    struct VectorTraitsBase;
 
     template<typename T>
     struct VectorTraitsBase<false, T>
@@ -71,11 +72,14 @@ namespace WTF {
         static const bool canCompareWithMemcmp = true;
     };
 
-    // we know RefPtr is simple enough that initializing to 0 and moving with memcpy
+    // we know OwnPtr and RefPtr are simple enough that initializing to 0 and moving with memcpy
     // (and then not destructing the original) will totally work
     template<typename P>
     struct VectorTraits<RefPtr<P> > : SimpleClassVectorTraits { };
-    
+
+    template<typename P>
+    struct VectorTraits<OwnPtr<P> > : SimpleClassVectorTraits { };
+
     template<typename P>
     struct VectorTraits<std::auto_ptr<P> > : SimpleClassVectorTraits { };