Guest_imported
New member
- Jan 1, 1970
- 0
I`m trying to cast a parent class to a child class using the typedef as a variable when casting but it comes up with the error, that it "expects a type def (typedef) when found a Shape":
// circle is a class
typedef Circle def;
// shape is a parent class for a child circle class
vector<Shape> Vec;
Shape shape1();
vec.push_back(shape1);
((def)shape1).data = "hello";
// circle is a class
typedef Circle def;
// shape is a parent class for a child circle class
vector<Shape> Vec;
Shape shape1();
vec.push_back(shape1);
((def)shape1).data = "hello";