iterator_facade with incomplete type as Value argument

I've tried writing an iterator with iterator_facade that returns itself
as the result of dereference, but the Value template argument requires a
complete type because it tries to make a difference between returning by
value or reference if Value is_pod (as far as I understand).
#include

Philipp Moeller
I've tried writing an iterator with iterator_facade that returns itself as the result of dereference, but the Value template argument requires a complete type because it tries to make a difference between returning by value or reference if Value is_pod (as far as I understand).
#include
class iter : public boost::iterator_facade< iter, iter, boost::forward_traversal_tag > { public: void fancy_non_iterator_member(); private: friend class boost::iterator_core_access;
void increment() { }
bool equal(iter const& other) const { return true; }
iter& dereference() const { return const_cast
(static_cast (*this)); } }; Is this the intended behavior of iterator_facade? Is there some workaround? Would such an iterator actually be conforming?
There is a mistake in the preceding post. iter::dereference should be
defined as:
iter& dereference() const { return const_cast
participants (1)
-
Philipp Moeller