我使用std::istream_iterator
迭代我的二进制文件读取,现在我想识别for循环的最后一次迭代!我怎么能这样做?
std::ifstream fwImage("file.img", std::ios::in | ios::binary);
typedef std::istream_iterator<BYTE> input_iterator;
for(input_iterator it(fwImage); it!=input_iterator(); it++)
{
// need a check when input_iterator is in his last iteration -> end of file
}