Boost logo

Boost :

Subject: Re: [boost] [iterator] Help needed understanding output_iterator requirements
From: Thomas Klimpel (Thomas.Klimpel_at_[hidden])
Date: 2010-03-15 15:46:21

Jeffrey Hellrung wrote:
> Without being an expert, a quick review of
> html#iterator-category
> shows that std::output_iterator_tag is never chosen as the iterator
> category by boost::iterator_facade. It also shows that the behavior of
> choosing std::input_iterator_tag for your particular case is the
> documented behavior.

Thanks, so at least I know now that I didn't misinterpreted the code in "facade_iterator_category.hpp". I fact, the documentation in "facade_iterator_category.hpp" itself was less clear with respect to this questions, so that I already wondered whether I had missed something in boost::multi_array causing the iterator not to be an output_iterator.

excerp from "facade_iterator_category.hpp":
// Convert an iterator_facade's traversal category, Value parameter,
// and ::reference type to an appropriate old-style category.
// If writability has been disabled per the above metafunction, the
// result will not be convertible to output_iterator_tag.
// Otherwise, if Traversal == single_pass_traversal_tag, the following
// conditions will result in a tag that is convertible both to
// input_iterator_tag and output_iterator_tag:
// 1. Reference is a reference to non-const
// 2. Reference is not a reference and is convertible to Value
template <class Traversal, class ValueParam, class Reference>
struct iterator_facade_default_category


Boost list run by bdawes at, gregod at, cpdaniel at, john at