Templating tut in c++