So in my .h file I have
template <class T> void getValue(T *val, int element, int index);
and then in my .cc file I have a function:
template <class T> void RParser::getValue(T *val, int element, int index) {
I also explicitly created it:
template void RParser::getValue<char>(char *val, int element, std::string subrecName); template void RParser::getValue<long long>(long long *val, int element, std::string subrecName); template void RParser::getValue<float>(float *val, int element, std::string subrecName); ...
this works, but I would like to make a completely different function for std :: string
I tried:
template <class std::string> void RParser::getValue<std::string>(std::string * val, int element, int index) {
but it didn’t work.
Any suggestions are welcome,
Thanks Josh
source share