28{
29
30 monomials::const_iterator it = other.
m.begin();
31 monomials::iterator pos_end =
m.end();
32 monomials::const_iterator other_end = other.
m.end();
33 while (it != other_end && pos != pos_end)
34 {
35
36 if (*it > *pos)
37 {
39 ++it;
40 }
41 else if (*it == *pos)
42 {
44 ++it;
45 }
46 else
47 {
48 ++pos;
49 }
50 }
51 if (pos == pos_end)
52 {
53 m.insert(pos, it, other_end);
54 }
55}