return *this;\r
strategy = other.strategy;\r
\r
+ // (TODO: we could probably avoid re-allocations of data when (allocated < other.allocated)\r
+\r
if (data)\r
clear();\r
\r
- //if (allocated < other.allocated)\r
- if (other.allocated == 0)\r
- data = 0;\r
- else\r
- data = allocator.allocate(other.allocated); // new T[other.allocated];\r
-\r
used = other.used;\r
free_when_destroyed = true;\r
is_sorted = other.is_sorted;\r
allocated = other.allocated;\r
\r
- for (u32 i=0; i<other.used; ++i)\r
- allocator.construct(&data[i], other.data[i]); // data[i] = other.data[i];\r
+ if (other.allocated == 0)\r
+ {\r
+ data = 0;\r
+ }\r
+ else\r
+ {\r
+ data = allocator.allocate(other.allocated); // new T[other.allocated];\r
+\r
+ for (u32 i=0; i<other.used; ++i)\r
+ allocator.construct(&data[i], other.data[i]); // data[i] = other.data[i];\r
+ }\r
\r
return *this;\r
}\r