Implementation of cta structures with C++ templates