I have a class defined as follows
class A
{
A()
~A();
.
.
.
}
And I use a vector of class A as below
Vec<A> objectA;
But when I use the set_size function (explicitly or implicitly) "objectA.set_size(N);"
I get a compile time error
it++\include\base\vec.h(520): error C2440: 'type cast' : cannot convert from 'int' to 'A'
Any pointers will be helpful.
Thanks,
Kripps/-
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Your class should provide a constructor in form:
A(int) in order to work with Vec properly, since Vec<Num_T>
uses Num_T(0) to initialize empty elements of vector.
Andy
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I have a class defined as follows
class A
{
A()
~A();
.
.
.
}
And I use a vector of class A as below
Vec<A> objectA;
But when I use the set_size function (explicitly or implicitly) "objectA.set_size(N);"
I get a compile time error
it++\include\base\vec.h(520): error C2440: 'type cast' : cannot convert from 'int' to 'A'
Any pointers will be helpful.
Thanks,
Kripps/-
Hi,
Your class should provide a constructor in form:
A(int) in order to work with Vec properly, since Vec<Num_T>
uses Num_T(0) to initialize empty elements of vector.
Andy