Array allocator
Posted: Thu Dec 26, 2013 7:41 pm
There was 2 lines in irrArray where the allocator is not used, in insert. Here is a patch to fix it:
Now the array can hold non-copy-assignable types without problems.
Here is the patch request: https://sourceforge.net/p/irrlicht/patches/278/
Code: Select all
Index: irrArray.h
===================================================================
--- irrArray.h (revision 4621)
+++ irrArray.h (working copy)
@@ -181,10 +181,12 @@
// move the rest of the array content
for (u32 i=used-1; i>index; --i)
{
- data[i] = data[i-1];
+ //data[i] = data[i-1];
+ allocator.construct(&data[i], data[i-1]);
}
// insert the new element
- data[index] = element;
+ //data[index] = element;
+ allocator.construct(&data[index], element);
}
else
{
Here is the patch request: https://sourceforge.net/p/irrlicht/patches/278/