是否可以比较两个迭代器?使用std::min进行比较。
void change ( typename TList <Item *>::Type ::iterator it_begin, typename TList <Item*>::Type ::iterator it_end )
{
....
this->items.resize ( index );
std::sort ( it_begin, std::min (it_end, it_begin += index - 1); //Compare two iterators, exception
....
}
抛出以下异常:
Assertion failed: Vector iterators incompatible...
还有其他比较的方法吗?
TList<Item *>::Type
和this->items
的类型是什么?这些迭代器指向this->items
吗? - Mooing Duck