299 constexpr ERRCODE DONT_EXCHANGE_DELETED(
"Can't exchange deleted elements of lists");
304 if ((list->
empty()) || (other_it->list->empty()) || (current == other_it->current)) {
310 if (!current || !other_it->current) {
311 DONT_EXCHANGE_DELETED.error(
"CLIST_ITERATOR.exchange",
ABORT,
nullptr);
319 if ((next == other_it->current) || (other_it->next == current)) {
321 if ((next == other_it->current) && (other_it->next == current)) {
322 prev = next = current;
323 other_it->prev = other_it->next = other_it->current;
327 if (other_it->next == current) {
328 other_it->prev->next = current;
329 other_it->current->next = next;
330 current->next = other_it->current;
331 other_it->next = other_it->current;
334 prev->next = other_it->current;
335 current->next = other_it->next;
336 other_it->current->next = current;
338 other_it->prev = other_it->current;
342 prev->next = other_it->current;
343 current->next = other_it->next;
344 other_it->prev->next = current;
345 other_it->current->next = next;
351 if (list->last == current) {
352 list->last = other_it->current;
354 if (other_it->list->last == other_it->current) {
355 other_it->list->last = current;
358 if (current == cycle_pt) {
359 cycle_pt = other_it->cycle_pt;
361 if (other_it->current == other_it->cycle_pt) {
362 other_it->cycle_pt = cycle_pt;
367 auto old_current = current;
368 current = other_it->current;
369 other_it->current = old_current;