diff --git a/paddle/fluid/framework/mixed_vector.h b/paddle/fluid/framework/mixed_vector.h index 26f160e509329ade920db5fa52c0fd2a3cb864e1..4dc3de54deef71e42d73e0943021691c5e39f7c7 100644 --- a/paddle/fluid/framework/mixed_vector.h +++ b/paddle/fluid/framework/mixed_vector.h @@ -247,8 +247,9 @@ class Vector { bool operator==(const Vector& other) const { if (size() != other.size()) return false; - for (const T *it1 = cbegin(), it2 = other.cbegin(); it1 < cend(); - ++it1, ++it2) { + auto it1 = cbegin(); + auto it2 = other.cbegin(); + for (; it1 < cend(); ++it1, ++it2) { if (*it1 != *it2) { return false; }