I have two variables, named ii and filesize,
both are of type ifstream::pos_type
filesize holds the size of a file to be iterated through,
and I have a simple do - while loop to do it.
But instead of running to the very end, I'd like it to stop
6 steps before hitting the file end. So, dumb as I am, I just have like:
1 2 3 4 5 6 7
|
ii=0;
do
{
// it actually does something here
ii+=1;
}
while (ii<(filesize-6));
|
but that "while (ii<filesize-6)" makes g++ to say:
warning: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
/usr/include/c++/4.4/bits/postypes.h:192: note: candidate 1: std::fpos<_StateT> std::fpos<_StateT>::operator-(std::streamoff) const [with _StateT = __mbstate_t]
browser.cpp:60: note: candidate 2: operator-(std::streamoff, int) <built-in>
Well, I think that the workaround is to have
before the do - while -loop
but still, I'd like to ask if there is an another way - as I'd like to keep the original value in filesize, because I need it later on in the code.
I hope this makes some sense.