Chromium Code Reviews| Index: src/vector.h |
| diff --git a/src/vector.h b/src/vector.h |
| index 505ef5ad5619bea29f48a6d03b7437169f2fafb1..8ac0d9a88f8c19b3607f0fd947f85e100585f3e1 100644 |
| --- a/src/vector.h |
| +++ b/src/vector.h |
| @@ -100,6 +100,16 @@ class Vector { |
| input.length() * sizeof(S) / sizeof(T)); |
| } |
| + bool operator==(const Vector<T>& other) { |
|
aandrey
2014/07/01 09:49:11
bool operator==() const {
marja
2014/07/01 11:33:58
Done.
|
| + if (length_ != other.length_) return false; |
|
aandrey
2014/07/01 09:49:11
if (this == &other) return true; ?
marja
2014/07/01 11:33:58
I think this is even better:
if (start_ == other.s
|
| + for (int i = 0; i < length_; ++i) { |
| + if (start_[i] != other.start_[i]) { |
| + return false; |
| + } |
| + } |
| + return true; |
| + } |
| + |
| protected: |
| void set_start(T* start) { start_ = start; } |