274 {
276 {
277 *this = anotherMonom;
278 }
279 else
280 {
281 if (anotherMonom.ListHead)
282 {
284 *anotherIterator = anotherMonom.ListHead;
285
286 while (*iterator && anotherIterator)
287 {
288 if ((*iterator)->Value == anotherIterator->Value)
289 {
290 iterator = &((*iterator)->Next);
291 anotherIterator = anotherIterator->Next;
292 }
293 else if ((*iterator)->Value < anotherIterator->Value)
294 {
295 iterator = &((*iterator)->Next);
296 }
297 else
298 {
300 newNode->Value = anotherIterator->Value;
301 newNode->Next = *iterator;
302 *iterator = newNode;
304
305 iterator = &(newNode->Next);
306 anotherIterator = anotherIterator->Next;
307 }
308 }
309
310 while (anotherIterator)
311 {
313 (*iterator)->Value = anotherIterator->Value;
315
316 iterator = &((*iterator)->Next);
317 anotherIterator = anotherIterator->Next;
318 }
319 }
320 }
321
322 return *this;
323 }
Singly linked-list node of a Monom's variable list, with a per-class slab allocator.