Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2150)

Unified Diff: Source/wtf/VectorTraits.h

Issue 240213009: Introduce a macro enabling 'SimpleClassVectorTraits' (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added the comment Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/heap/HeapTest.cpp ('k') | Source/wtf/text/AtomicString.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « Source/platform/heap/HeapTest.cpp ('k') | Source/wtf/text/AtomicString.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698