I am getting the following error when I try to build the code.
src/Test.cxx:29: error: specialization of 'template T com::check::one::Test::getValue(const std::string&)' in different namespace ./incl/Test.hxx:30: error: from definition of 'template T com::check::one::Test::getValue(const std::string&)' src/Test.cxx:31: confused by earlier errors, bailing out
Header file:
namespace com::check::one
{
class Test
{
public:
template<typename T>
T getValue(const std::string& var);
};
}
Source File:
using namespace com::check::one;
template<>
std::vector<std::string> Test::getValue(const std::string& var)
{
//statements
}
I am using the correct namespace and included the header file as well. No issues in compile. Even I have defined other member functions of the Test Class in source file. No issues for those functions. Only there is a issue with this function which has template. The error is during build. Can anyone help me to resolve this issue?