Changeset 37526 in webkit for trunk/JavaScriptCore/wtf/Vector.h


Ignore:
Timestamp:
Oct 12, 2008, 12:51:33 PM (17 years ago)
Author:
[email protected]
Message:

2008-10-12 Anders Carlsson <[email protected]>

Reviewed by Darin Adler.

Make the append method that takes a Vector more strict - it now requires the elements
of the vector to be appended same type as the elements of the Vector they're being appended to.


This would cause problems when dealing with Vectors containing other Vectors.


  • wtf/Vector.h: (WTF::::append):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/Vector.h

    r37184 r37526  
    499499        template<typename U> void append(const U&);
    500500        template<typename U> void uncheckedAppend(const U& val);
    501         template<typename U, size_t c> void append(const Vector<U, c>&);
     501        template<size_t otherCapacity> void append(const Vector<T, otherCapacity>&);
    502502
    503503        template<typename U> void insert(size_t position, const U*, size_t);
     
    794794    }
    795795
    796     template<typename T, size_t inlineCapacity> template<typename U, size_t c>
    797     inline void Vector<T, inlineCapacity>::append(const Vector<U, c>& val)
     796    // This method should not be called append, a better name would be appendElements.
     797    // It could also be eliminated entirely, and call sites could just use
     798    // appendRange(val.begin(), val.end()).
     799    template<typename T, size_t inlineCapacity> template<size_t otherCapacity>
     800    inline void Vector<T, inlineCapacity>::append(const Vector<T, otherCapacity>& val)
    798801    {
    799802        append(val.begin(), val.size());
Note: See TracChangeset for help on using the changeset viewer.