Changeset 35425 in webkit for trunk/JavaScriptCore/wtf/Vector.h
- Timestamp:
- Jul 29, 2008, 11:51:26 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/wtf/Vector.h
r35269 r35425 37 37 using std::max; 38 38 39 const size_t notFound = static_cast<size_t>(-1); 40 39 41 template <bool needsDestruction, typename T> 40 42 class VectorDestructor; … … 461 463 const T& last() const { return at(size() - 1); } 462 464 463 template<typename U> iterator find(const U& value) { return std::find(begin(), end(), value); } 464 template<typename U> const_iterator find(const U& value) const { return std::find(begin(), end(), value); } 465 template<typename U> size_t find(const U&) const; 465 466 466 467 void shrink(size_t size); … … 586 587 587 588 return *this; 589 } 590 591 template<typename T, size_t inlineCapacity> 592 template<typename U> 593 size_t Vector<T, inlineCapacity>::find(const U& value) const 594 { 595 for (size_t i = 0; i < size(); ++i) { 596 if (at(i) == value) 597 return i; 598 } 599 return notFound; 588 600 } 589 601
Note:
See TracChangeset
for help on using the changeset viewer.