Index: Source/wtf/VectorTraits.h |
diff --git a/Source/wtf/VectorTraits.h b/Source/wtf/VectorTraits.h |
index 74cc1d8fbd15a969901c3334782e64045bfcb415..fe54ffe3fa512047f6d87099c530c75d452f40de 100644 |
--- a/Source/wtf/VectorTraits.h |
+++ b/Source/wtf/VectorTraits.h |
@@ -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,12 @@ namespace WTF { |
} // namespace WTF |
+#define WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(ClassName) \ |
+namespace WTF { \ |
+ template<> \ |
+ struct VectorTraits<ClassName> : SimpleClassVectorTraits<ClassName> { }; \ |
+} |
+ |
using WTF::VectorTraits; |
using WTF::SimpleClassVectorTraits; |