Pretty simple question really; why is this giving me an error:
1 2 3
for (auto iB = next(B->begin(),B_size), lim_iB = B->end(); iB != lim_iB; iB++) {
// error C3538: in a declarator-list 'auto' must always deduce to the same type
}
I don't see why this doesn't work; I had initially tried this:
1 2 3
for (auto iB = B->begin() + B_size, lim_iB = B->end(); iB != lim_iB; iB++) {
// error C3538: in a declarator-list 'auto' must always deduce to the same type
}
Which also didn't work; although I would have thought the use of "next" would fix it. What could "next" possibly return other than an iterator type??
The following compiles, but it's a ugly and probably more expensive:
1 2 3
for (auto iB = next(B->begin(),B_size), lim_iB = next(B->end(),0); iB != lim_iB; iB++) {
// error C3538: in a declarator-list 'auto' must always deduce to the same type
}