다음 코드, 미세 MSVC하지만, 컴파일 구축 GCC 오류를 많이 제공하는 경우 :오류 부분 템플릿 컴파일 GCC에서 전문화,하지만 MSVC
#define FORCE_INLINE inline
#define CREF(A) const A&
template <class F>
class RDOFunCalcStd: public RDOFunCalc
{
...
template <class T>
FORCE_INLINE T getParam(CREF(LPRDORuntime) pRuntime, ruint paramNumber);
template <>
FORCE_INLINE double getParam<double>(CREF(LPRDORuntime) pRuntime, ruint paramNumber)
{
return pRuntime->getFuncArgument(paramNumber).getDouble();
}
template <>
FORCE_INLINE int getParam<int>(CREF(LPRDORuntime) pRuntime, ruint paramNumber)
{
return pRuntime->getFuncArgument(paramNumber).getInt();
}
...
};
오류 목록 :
을error: explicit specialization in non-namespace scope ‘class rdoRuntime::RDOFunCalcStd’
error: template-id ‘getParam’ in declaration of primary template
error: explicit specialization in non-namespace scope ‘class rdoRuntime::RDOFunCalcStd’
error: template-id ‘getParam’ in declaration of primary template
error: ‘int rdoRuntime::RDOFunCalcStd::getParam(const rdoRuntime::LPRDORuntime&, ruint)’ cannot be overloaded
error: with ‘double rdoRuntime::RDOFunCalcStd::getParam(const rdoRuntime::LPRDORuntime&, ruint)’
오류를 해결하려면 어떻게해야합니까?