c++ template practise