… | |
… | |
37 | // - no bool specialisation |
37 | // - no bool specialisation |
38 | template<class T> |
38 | template<class T> |
39 | struct simplevec |
39 | struct simplevec |
40 | { |
40 | { |
41 | #if ESTL_BIG_VECTOR |
41 | #if ESTL_BIG_VECTOR |
42 | // shoudl use size_t/ssize_t, but that's not portable enough for us |
42 | // should use size_t/ssize_t, but that's not portable enough for us |
43 | typedef unsigned long size_type; |
43 | typedef unsigned long size_type; |
44 | typedef long difference_type; |
44 | typedef long difference_type; |
45 | #else |
45 | #else |
46 | typedef uint32_t size_type; |
46 | typedef uint32_t size_type; |
47 | typedef int32_t difference_type; |
47 | typedef int32_t difference_type; |
… | |
… | |
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 | |
160 | public: |
160 | public: |
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; |