我正在尝试拼接此列表,但在调用拼接时出现错误提示没有匹配函数。据我所知,我所有的#includes 都是正确的。
错误来自调用 temp 的每一行。
void DeckOps::encrypt(int msize, list<int> *L){
int jokeA = 27;
int jokeB = 28;
string keystream;
list<int>::iterator a = std::find(L->begin(), L->end(), jokeA);
list<int>::iterator new_position = a;
for(int i=0; i < 1 && new_position != L->begin(); i++)
new_position--;
L->insert(new_position, 1, *a);
L->erase(b);
list<int>::iterator aa = L->begin();
int sec;
for(; aa != L->end(); aa++){
if(*aa == jokeA || *aa == jokeB)
break; //aa is at 1st inlist either 27 or 28
}
if(*aa == jokeA){
sec = jokeA;
} else {
sec = jokeB;
}
list<int>::iterator bb = std::find(L->begin(), L->end(), sec);
// everything works up to this point it seems
list<int> temp;
temp.splice(temp.end(), L, aa, bb);
temp.splice(temp.end(), L, bb);
temp.splice(temp.end(), L, begin(), aa);
L->splice(L->end(), L, aa);
L->splice(L->end(), temp);
//testing
std::copy(L->begin(), L->end(), std::ostream_iterator<int>(std::cout, " "));
}