From 190119bb98eaca554bb183488f6828fd2b3e18c0 Mon Sep 17 00:00:00 2001 From: Yu Yang Date: Sun, 11 Feb 2018 11:28:32 +0800 Subject: [PATCH] Extract for-loop init. Make nvcc happy --- paddle/fluid/framework/mixed_vector.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/framework/mixed_vector.h b/paddle/fluid/framework/mixed_vector.h index 26f160e50..4dc3de54d 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; } -- GitLab