I fixed the template definitions so that they work with compilers that
are not g++, since g++ allows definitions of templated members inside of
.cpp files and this is not standard practice.