苹果.hclassApple{public:Apple(int);staticinttypeID;private:intid_;};苹果.cpp#include"Apple.h"Apple::Apple(intpID){id_=pID;}Potato.h,Potato.cpp与苹果相同存储.h#pragmaonce#include"Apple.h"#include"Potato.h"#includeclassStorage{public:Storage();templatevoidstore(foodName*object){(*getBasket()).push_back(objec