Code from Inspired by Yakk's question on SO about currying in C++.