Templated Abstract Data Type in C++