Index: src/list-inl.h |
diff --git a/src/list-inl.h b/src/list-inl.h |
index e41db11fc5430d1120cc13c823d71f46f84706ce..e277bc87234434480bd49430b3ce70756f612199 100644 |
--- a/src/list-inl.h |
+++ b/src/list-inl.h |
@@ -127,6 +127,13 @@ void List<T, P>::Iterate(void (*callback)(T* x)) { |
template<typename T, class P> |
+template<class Visitor> |
+void List<T, P>::Iterate(Visitor* visitor) { |
+ for (int i = 0; i < length_; i++) visitor->Apply(&data_[i]); |
+} |
+ |
+ |
+template<typename T, class P> |
bool List<T, P>::Contains(const T& elm) { |
for (int i = 0; i < length_; i++) { |
if (data_[i] == elm) |