Fehler beim Kompilieren des folgenden Programms mit GCC/G ++ - Compiler unter Cygwin - /src/Template_1.cpp:66:2: Fehler: erwartete primäre Ausdruck vor 'Vorlage' Vorlage TemplateCall: : VorlageAnruf; ^C++ - Vorlage - primärer Ausdruck benötigt
Mein Quellcode ist wie folgt: -
#include<iostream>
#include<cstdarg>
using namespace std;
template<class T>
class TemplateCall
{
private:
T dataValue;
public:
TemplateCall(T somethingValue);
void showTTParam();
};
template<class T>
TemplateCall<T>::TemplateCall(T somethingValue)
{
cout << endl << " Calling TemplateCall - constructor " << endl;
dataValue = somethingValue;
}
template<class T>
void TemplateCall<T>::showTTParam()
{
cout << endl << " TemplateTemplateParam - showTTParam " << endl;
cout << endl << " dataValue - showTTParam " << dataValue << endl;
}
int main()
{
template TemplateCall<int>;
return 0;
}
Was versuchen Sie mit der Vorlage TemplateCall; '? –