A teaser, again. This time with std:: stuff instead of Qt. Why? Because I can :)
list <string> inputList;
// ... do something to the inputList ...
string first, second;
list <string> outputList;
(QfTuple | first, second, outputList)
= inputList.begin();
// or just (and it is safer)
(QfTuple | first, second, outputList)
= inputList;
// now, the variables first and second contain
// the first two elements of the inputList, and
// outputList contains the rest
I'd be afraid to use this in real-life C++ code though, just because it's so uncommon to see the operators overloaded like that. So in the end this might be just yet another funky cocktail-party trick to demonstrate cute uses of operator overloading. :-/
I think this would be more useful if it would actually select between multiple patterns, depending on which one matches first.