simplified c++ template