Functional data structures in C++