Title: [195339] trunk/Source/WTF
Revision
195339
Author
sbar...@apple.com
Date
2016-01-19 20:39:54 -0800 (Tue, 19 Jan 2016)

Log Message

WTF::Bag should be non-copyable
https://bugs.webkit.org/show_bug.cgi?id=153253

Reviewed by Filip Pizlo.

* wtf/Bag.h:
* wtf/SegmentedVector.h:
(WTF::SegmentedVector::append):
(WTF::SegmentedVector::alloc):

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (195338 => 195339)


--- trunk/Source/WTF/ChangeLog	2016-01-20 04:37:13 UTC (rev 195338)
+++ trunk/Source/WTF/ChangeLog	2016-01-20 04:39:54 UTC (rev 195339)
@@ -1,3 +1,15 @@
+2016-01-19  Saam barati  <sbar...@apple.com>
+
+        WTF::Bag should be non-copyable
+        https://bugs.webkit.org/show_bug.cgi?id=153253
+
+        Reviewed by Filip Pizlo.
+
+        * wtf/Bag.h:
+        * wtf/SegmentedVector.h:
+        (WTF::SegmentedVector::append):
+        (WTF::SegmentedVector::alloc):
+
 2016-01-19  Enrica Casucci  <enr...@apple.com>
 
         Add support for DataDetectors in WK (iOS).

Modified: trunk/Source/WTF/wtf/Bag.h (195338 => 195339)


--- trunk/Source/WTF/wtf/Bag.h	2016-01-20 04:37:13 UTC (rev 195338)
+++ trunk/Source/WTF/wtf/Bag.h	2016-01-20 04:39:54 UTC (rev 195339)
@@ -30,6 +30,7 @@
 
 template<typename T>
 class Bag {
+    WTF_MAKE_NONCOPYABLE(Bag);
     WTF_MAKE_FAST_ALLOCATED;
 private:
     class Node {

Modified: trunk/Source/WTF/wtf/SegmentedVector.h (195338 => 195339)


--- trunk/Source/WTF/wtf/SegmentedVector.h	2016-01-20 04:37:13 UTC (rev 195338)
+++ trunk/Source/WTF/wtf/SegmentedVector.h	2016-01-20 04:39:54 UTC (rev 195339)
@@ -132,18 +132,19 @@
             return at(size() - 1);
         }
 
-        template <typename U> void append(U&& value)
+        template<typename... Args>
+        void append(Args&&... args)
         {
             ++m_size;
             if (!segmentExistsFor(m_size - 1))
                 allocateSegment();
-            new (NotNull, &last()) T(std::forward<U>(value));
+            new (NotNull, &last()) T(std::forward<Args>(args)...);
         }
 
         template<typename... Args>
         T& alloc(Args&&... args)
         {
-            append<T>(T(std::forward<Args>(args)...));
+            append(std::forward<Args>(args)...);
             return last();
         }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to