I'm learning about templates in C++. In MyClass.h:
template <class valueType>
void valueToMap(const std::string key, const valueType value);
In MyClass.cpp:
void MyClass::valueToMap(const std::string key, const valueType value) // error
^
{
_map[key] = std::to_string(value);
}
The error is: Unknown type name 'valueType' I've included the header file, so what am I doing wrong?