Lines 17-23
template <class T> class CDynamicBuffer: public CBuffer<T>
Link Here
|
17 |
else |
17 |
else |
18 |
delta = 4; |
18 |
delta = 4; |
19 |
delta = MyMax(delta, size); |
19 |
delta = MyMax(delta, size); |
20 |
SetCapacity(this->_capacity + delta); |
20 |
this->SetCapacity(this->_capacity + delta); |
21 |
} |
21 |
} |
22 |
public: |
22 |
public: |
23 |
CDynamicBuffer(): CBuffer<T>() {}; |
23 |
CDynamicBuffer(): CBuffer<T>() {}; |
Lines 28-34
public:
Link Here
|
28 |
this->Free(); |
28 |
this->Free(); |
29 |
if (buffer._capacity > 0) |
29 |
if (buffer._capacity > 0) |
30 |
{ |
30 |
{ |
31 |
SetCapacity(buffer._capacity); |
31 |
this->SetCapacity(buffer._capacity); |
32 |
memmove(this->_items, buffer._items, buffer._capacity * sizeof(T)); |
32 |
memmove(this->_items, buffer._items, buffer._capacity * sizeof(T)); |
33 |
} |
33 |
} |
34 |
return *this; |
34 |
return *this; |
35 |
- |
|
|