나는 템플릿 전문화를 이해하려고 노력해 왔습니다. 왜 이런 오류 (specialization of 'T foo(T, T) [with T = int]' after instantiation
)를 생성한다C에서 템플릿 전문화
template <class T> T foo(T a, T b);
int main()
{
int x=34, y=54;
cout<<foo(x, y);
}
template <class T> T foo(T a, T b)
{
return a+b;
}
template <> int foo<int>(int a, int b)
{
cout<<"int specialization";
}
그냥 main''전에 정의를 이동합니다. –
내 안드로이드 폰으로 질문을하는 중에 비가 내리고 앉을 수는 있지만 할 수 없다. 시간에 대답을한다. –
@ JohannesSchaub-litb 너는 중독된다 !! 도움을 구하다 ;) –