diff --git a/src/wrapper.hh b/src/wrapper.hh index d22d37b..287550c 100644 --- a/src/wrapper.hh +++ b/src/wrapper.hh @@ -5,6 +5,7 @@ #define LIBPEPDATATYPES_WRAPPER_HH #include +#include namespace pEp { @@ -129,14 +130,15 @@ public: static Element T::* const Value; // to access the current value // does not own the *value - class iterator + class iterator : public std::iterator< std::forward_iterator_tag, Element, ptrdiff_t> { public: + iterator() = default; - iterator operator++() { return (value ? value = value->next : value); } - Element operator*() { return value->*LW::Value; } - Element operator->() { return (value->*LW::Value); } + iterator operator++() { return (value ? value = value->next : value); } + Element operator*() { return value->*LW::Value; } + Element operator->() { return value->*LW::Value; } bool operator==(const iterator& other) const { return value == other.value; } bool operator!=(const iterator& other) const { return value != other.value; }