289 constexpr ERRCODE DONT_EXCHANGE_DELETED(
"Can't exchange deleted elements of lists");
291 ELIST2_LINK *old_current;
298 if (!(other_it->list))
305 if ((list->
empty()) || (other_it->list->empty()) || (current == other_it->current)) {
311 if (!current || !other_it->current) {
312 DONT_EXCHANGE_DELETED.error(
"ELIST2_ITERATOR.exchange",
ABORT,
nullptr);
320 if ((next == other_it->current) || (other_it->next == current)) {
322 if ((next == other_it->current) && (other_it->next == current)) {
323 prev = next = current;
324 other_it->prev = other_it->next = other_it->current;
328 if (other_it->next == current) {
329 other_it->prev->next = current;
330 other_it->current->next = next;
331 other_it->current->prev = current;
332 current->next = other_it->current;
333 current->prev = other_it->prev;
334 next->prev = other_it->current;
336 other_it->next = other_it->current;
339 prev->next = other_it->current;
340 current->next = other_it->next;
341 current->prev = other_it->current;
342 other_it->current->next = current;
343 other_it->current->prev = prev;
344 other_it->next->prev = current;
347 other_it->prev = other_it->current;
351 prev->next = other_it->current;
352 current->next = other_it->next;
353 current->prev = other_it->prev;
354 next->prev = other_it->current;
355 other_it->prev->next = current;
356 other_it->current->next = next;
357 other_it->current->prev = prev;
358 other_it->next->prev = current;
364 if (list->last == current) {
365 list->last = other_it->current;
367 if (other_it->list->last == other_it->current) {
368 other_it->list->last = current;
371 if (current == cycle_pt) {
372 cycle_pt = other_it->cycle_pt;
374 if (other_it->current == other_it->cycle_pt) {
375 other_it->cycle_pt = cycle_pt;
380 old_current = current;
381 current = other_it->current;
382 other_it->current = old_current;