宋是一類 ,我想訪問它的一個公共方法遍歷矢量++
class RadioManager {
std::vector<Song> all_songs;
public:
void addSong(const Song& song);
}
void mtm::RadioManager::addSong(const Song& song){
vector<Song>::iterator i;
for (i = all_songs.begin(); i != all_songs.end(); ++i) {
i->getSongName(); // When i type i-> i don't get the list of methods in the class song;
}
它爲什麼不顯示我的迭代器的內容是什麼?
它給編譯器錯誤嗎? –
大概你在談論你的IDE的某些功能,也許是Intellisense?你應該說清楚。你的問題不是關於C++,而是關於你的IDE –