Changeset 195339 in webkit


Ignore:
Timestamp:
Jan 19, 2016 8:39:54 PM (8 years ago)
Author:
sbarati@apple.com
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):

Location:
trunk/Source/WTF
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r195317 r195339  
     12016-01-19  Saam barati  <sbarati@apple.com>
     2
     3        WTF::Bag should be non-copyable
     4        https://bugs.webkit.org/show_bug.cgi?id=153253
     5
     6        Reviewed by Filip Pizlo.
     7
     8        * wtf/Bag.h:
     9        * wtf/SegmentedVector.h:
     10        (WTF::SegmentedVector::append):
     11        (WTF::SegmentedVector::alloc):
     12
    1132016-01-19  Enrica Casucci  <enrica@apple.com>
    214
  • trunk/Source/WTF/wtf/Bag.h

    r187587 r195339  
    3131template<typename T>
    3232class Bag {
     33    WTF_MAKE_NONCOPYABLE(Bag);
    3334    WTF_MAKE_FAST_ALLOCATED;
    3435private:
  • trunk/Source/WTF/wtf/SegmentedVector.h

    r193362 r195339  
    133133        }
    134134
    135         template <typename U> void append(U&& value)
     135        template<typename... Args>
     136        void append(Args&&... args)
    136137        {
    137138            ++m_size;
    138139            if (!segmentExistsFor(m_size - 1))
    139140                allocateSegment();
    140             new (NotNull, &last()) T(std::forward<U>(value));
     141            new (NotNull, &last()) T(std::forward<Args>(args)...);
    141142        }
    142143
     
    144145        T& alloc(Args&&... args)
    145146        {
    146             append<T>(T(std::forward<Args>(args)...));
     147            append(std::forward<Args>(args)...);
    147148            return last();
    148149        }
Note: See TracChangeset for help on using the changeset viewer.