ここに何か不足していますか?またはこれが許可されていない理由はありますか? healthpacksのでテンプレートの基本クラスを基本クラスの引数として使用するクラス
// the class declaration
class MapImage : public MapEntity, public Vector2D {};
// the variable declaration
std::vector<MapImage> healthpacks;
// the function
void DrawItems(SDL_Surface *dest, std::vector<Vector2D> &items, SDL_Surface *image);
// the implementation
DrawItems(dest, healthpacks, healthpack_image);
は:: MapImageクラスのベクターSTDであり、そしてMapImageは、ベースクラスVector2Dを有し、「STD ::ベクトルhealthpacks」は彼らので、「STD ::ベクター&アイテム」と互換性があってはなりません同じ基本クラスですか?
はい。どのようなコンパイルエラーがありますか? –
<またはbackticksを使用して、のベクトルが質問テキストに誤って解析されることはありません()。 –