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>
{
} // 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;