273 constexpr ERRCODE DONT_EXCHANGE_DELETED(
"Can't exchange deleted elements of lists");
275 ELIST_LINK *old_current;
282 if (!(other_it->list))
289 if ((list->
empty()) || (other_it->list->empty()) || (current == other_it->current)) {
295 if (!current || !other_it->current) {
296 DONT_EXCHANGE_DELETED.error(
"ELIST_ITERATOR.exchange",
ABORT,
nullptr);
304 if ((next == other_it->current) || (other_it->next == current)) {
306 if ((next == other_it->current) && (other_it->next == current)) {
307 prev = next = current;
308 other_it->prev = other_it->next = other_it->current;
312 if (other_it->next == current) {
313 other_it->prev->next = current;
314 other_it->current->next = next;
315 current->next = other_it->current;
316 other_it->next = other_it->current;
319 prev->next = other_it->current;
320 current->next = other_it->next;
321 other_it->current->next = current;
323 other_it->prev = other_it->current;
327 prev->next = other_it->current;
328 current->next = other_it->next;
329 other_it->prev->next = current;
330 other_it->current->next = next;
336 if (list->last == current) {
337 list->last = other_it->current;
339 if (other_it->list->last == other_it->current) {
340 other_it->list->last = current;
343 if (current == cycle_pt) {
344 cycle_pt = other_it->cycle_pt;
346 if (other_it->current == other_it->cycle_pt) {
347 other_it->cycle_pt = cycle_pt;
352 old_current = current;
353 current = other_it->current;
354 other_it->current = old_current;