Qt Functional
Qt Functional

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

You can support my work on , or you can get my book Functional Programming in C++ at if you're into that sort of thing.