On 08.05.2014 12:43, Jens Müller wrote:
My current idea is actually a sort of proxy output iterator which keeps a counter of "pending" indeterminate tribools and flushes them to the proxied output iterator once their status becomes known. It should also automatically flush in it's destructor.
I did just that: A function object with a just three member variables: a pending count, the "last real value" bool, and an output iterator. And then I wrapped this in a boost::function_output_iterator.
Then I could just use std::copy with a std::back_inserter in order to convert a sequence including indeterminate values into a sequence just containing bools.
Actually, I am using it in a std::transform now (instead of a std::copy, a simple std::foreach with the function object would have sufficed), so that I can directly compute the visibility (as tribool) of the elements.