Function templates in C++
A reference to myself.
Function templates have two faces. Either they are a member of a non-template class, or they are free functions in the global or some namespace.
These are a member of a non-template class, with function templates.
// filename: interface.hpp
class interface
{
protected:
template<typename RESULTS, typename DATA>
void insert(RESULTS &results, const DATA &data);
}
// filename: interface.cpp
#include "interface.hpp"
// Full specialization
template<>
void interface::insert<>( Results &results, const Data &data )
{
// do stuff
}