我从来没有遇到过迭代器的以下问题,所以我真的不知道解决方案可能从哪里开始。我有一个列表“StringOfPearls”,在我执行以下操作之前已对其进行了置换:
DNAr = StringOfPearls->begin(); // Added 1 element to the beginning of this list in earlier line of code
cout << "pos DNAr before bumping by 1: " << distance(DNAreplicase, StringOfPearls->begin()) << endl;
advance(DNAreplicase, 1);
cout << "pos DNAr after bumping by 1: " << distance(DNAreplicase, StringOfPearls->begin()) << endl;
回报:
pos DNAr before bumping by 1: 0
pos DNAr after bumping by 1: 10
毫无疑问,我只是错过了一些愚蠢的事情,但是有人可以帮助我吗?