making a map in which the value type is an abstract class in C++
问题 I have an abstract class element and a child class elasticFrame : class element { public: virtual Matrix getStiffness() = 0; protected: Matrix K; }; class elasticFrame3d:public element { public: elasticFrame3d(double E, double G); virtual Matrix getStiffness(); virtual Matrix getTransform(); private: double E, G; }; what I want is to make a map like this: map<int, element> elementMap; but when I get this error: error C2259: 'element' : cannot instantiate abstract class is it even possible to