Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / wtf / VectorTraits.h
index 74cc1d8..d93fa51 100644 (file)
@@ -52,6 +52,9 @@ namespace WTF {
     template<typename T>
     struct VectorTraits : VectorTraitsBase<T> { };
 
+    // Classes marked with SimpleVectorTraits will use memmov, memcpy, memcmp
+    // instead of constructors, copy operators, etc for initialization, move
+    // and comparison.
     template<typename T>
     struct SimpleClassVectorTraits : VectorTraitsBase<T>
     {
@@ -91,6 +94,22 @@ namespace WTF {
 
 } // namespace WTF
 
+#define WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(ClassName) \
+namespace WTF { \
+    template<> \
+    struct VectorTraits<ClassName> : SimpleClassVectorTraits<ClassName> { }; \
+}
+
+#define WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(ClassName) \
+namespace WTF { \
+    template<> \
+    struct VectorTraits<ClassName> : VectorTraitsBase<ClassName> \
+    { \
+        static const bool canInitializeWithMemset = true; \
+        static const bool canMoveWithMemcpy = true; \
+    }; \
+}
+
 using WTF::VectorTraits;
 using WTF::SimpleClassVectorTraits;