for (torrent_info::file_iterator i = t.begin_files();
i != t.end_files(); ++i, ++index)
{
int first = t.map_file(index, 0, 1).piece;
int last = t.map_file(index, i->size - 1, 1).piece;
std::cout << " " << std::setw(11) << i->size
<< " " << i.filename() << "[ " << first << ", "
<< last << " ]\n";
}
编译给我以下错误:
error: ‘class __gnu_cxx::__normal_iterator<const libtorrent::internal_file_entry*, std::vector<libtorrent::internal_file_entry, std::allocator<libtorrent::internal_file_entry> > >’ has no member named ‘filename’
AFAICSi
是一个常量结构,internal_file_entry
其头代码位于开源 libtorrent 项目中。我只是第一次看 C++,但我一生都无法弄清楚为什么上述调用在编译时失败?i.filename()