Jens Theisen
David Abrahams wrote:
List< char > l = makeList(some_std_string) + makeList(some_char_array); We call that "any_iterator" (see http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?LibrariesUnde...)
I think I focusing more on compounds like the above concatenation, but also filters and maps. I want to have the list expressiveness of Lisp, Haskell or Python to define what collections I want to have rather than using the stl algorithms to tell how collections are being contructed.
Well, a generalized single-pass iterator can't be writable unless it has a proxy reference, IIRC. Otherwise, how does *x = a; work?
According to the new iterator concepts it should be perfectly fine to have an lvalue access single-pass iterator.
Yes. My point is that the iterator_facade framework is making some deductions about your iterator's capabilities based on the reference type you supplied. The logic is that if *x returns a real reference, then either the iterator must not be writable, or the referenced object must persist past the iterator's lifetime and therefore the iterator could be multipass. I suppose it's possible to build a writable single-pass iterator that just throws out the data you write into it... -- Dave Abrahams Boost Consulting www.boost-consulting.com