class StationSongs {
protected:
int original_song;
};
class NewsRadio: public StationSongs {
public:
NewsRadio()
{
current_song = NULL;
currently_empty = 0;
original_song = 0;
start_time_of_song = 0;
next_song_to_play = NULL;
}
};
class CommercialRadio : public StationSongs {
public:
CommercialRadio() {
current_song = NULL;
currently_empty = 0;
original_song = 0;
start_time_of_song = 0;
next_song_to_play = NULL;
}
};
问题:我想使用继承类作为映射值
地图是:
typedef MtmMap<double, StationSongs*> RadioMap;
method{
CommercialRadio new_station();
RadioPair new_pair(stationFrequency,*new_station);
radio.insert(new_pair);
}
我得到这个错误:
Multiple markers at this line
- no matching function for call to 'mtm::MtmMap<double, mtm::StationSongs*>::Pair::Pair(double&,
mtm::CommercialRadio
(&)())'
我该如何解决这个???