
[...]
If that is a useful expression, it's more of a set operation than a junction operation (as exemplified by Perl's junctions) anyway,
http://www.linux-magazine.com/issue/38/Perl_BlackJack.pdf. This is the article from where my idea comes to have something similar in C++ (I read the German translation in Linux Magazin 12/2003)
right? Besides, normal algorithms can be used to express that quite succinctly. Do you need a new type for it? Maybe. I don't think it should be merged with the simpler ideas from Perl junctions. I think they are orthogonal behaviors, and the complexity argues against one type doing both tasks.
The Perl junctions aren't simpler, in Perl you can call functions either in a scalar context or in a list context. The called function can determine in which context it is called and return a scalar or a list. I think my mistake was, I tried to bring this concept into C++ for junctions, but it doesn't fit into the C++ type system. And there was no example for this in the article I denoted in my first message. A junction without junction result type and arithmetic operations is something completely different I had in mind at the beginning of this discussion. What remains now at the view point of the client are the four functions any_of<T>, all_of<T>, one_of<T> and none_of<T> and the comparison operators. The XXX_of functions should operate on ranges or containers. I aggree. Florian