P
paul
When I compile class B shown below, in VC Express 2005, I get error
C2061: syntax error : identifier '{ctor}. Would appreciate any info on
how to avoid the error.
ref class X{
X();
~X();
};
ref class Y{
Y();
~Y();
};
template <class T1,class T2>
ref class A {
public:
A();
~A();
private:
T1^ t1;
T2^ t2;
};
A::A(){
t1 = gcnew T1();
t2 = gcnew T2();
}
ref class B {
static A<X,Y>^ a = gcnew A<X,Y>::A();
};
ptrue
C2061: syntax error : identifier '{ctor}. Would appreciate any info on
how to avoid the error.
ref class X{
X();
~X();
};
ref class Y{
Y();
~Y();
};
template <class T1,class T2>
ref class A {
public:
A();
~A();
private:
T1^ t1;
T2^ t2;
};
A::A(){
t1 = gcnew T1();
t2 = gcnew T2();
}
ref class B {
static A<X,Y>^ a = gcnew A<X,Y>::A();
};
ptrue