ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libptytty/src/estl.h
(Generate patch)

Comparing libptytty/src/estl.h (file contents):
Revision 1.21 by root, Thu Oct 23 20:21:52 2014 UTC vs.
Revision 1.23 by sf-exg, Fri Oct 24 13:44:09 2014 UTC

145 buf = nbuf; 145 buf = nbuf;
146 } 146 }
147 147
148 construct (buf + sze, n); 148 construct (buf + sze, n);
149 149
150 sze += n;
151
152 iterator src = buf + pos; 150 iterator src = buf + pos;
153 if (is_simple_enough ()) 151 if (is_simple_enough ())
154 memmove (src + n, src, sizeof (T) * n); 152 memmove (src + n, src, sizeof (T) * (sze - pos));
155 else 153 else
156 for (size_type i = n; i--; ) 154 for (size_type i = sze - pos; i--; )
157 cop_set (src + n + i, src + i); 155 cop_set (src + n + i, src + i);
156
157 sze += n;
158 } 158 }
159 159
160public: 160public:
161 size_type capacity () const { return res; } 161 size_type capacity () const { return res; }
162 size_type size () const { return sze; } 162 size_type size () const { return sze; }
326 size_type c = end () - last; 326 size_type c = end () - last;
327 327
328 if (is_simple_enough ()) 328 if (is_simple_enough ())
329 memmove (first, last, sizeof (T) * c); 329 memmove (first, last, sizeof (T) * c);
330 else 330 else
331 copy<iterator> (first, last, c, cop_set); 331 copy (first, last, c, cop_set);
332 332
333 sze -= n; 333 sze -= n;
334 destruct (buf + sze, n); 334 destruct (buf + sze, n);
335 335
336 return first; 336 return first;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines