[fixed]irr::list copy constructor and operator=
Posted: Thu Jun 22, 2006 12:12 am
This is not necessarly a bug, but they work different than std::list so i thought i mention it. I think the std::list does not copy the nodes but only the elements of a list.
The difference can be seen in the following behaviour:
core::list will crash in both cases in the destructor because after copying the list-nodes will be referenced by both lists.
I'd recommend changing it, but i'm not sure if there ain't already code in the engine expecting that behavior...
The difference can be seen in the following behaviour:
Code: Select all
std::list<int> stdA;
stdA.push_back(1);
std::list<int> stdB(stdA);
std::list<int> stdC;
stdC = stdA;
core::list<int> irrA;
irrA.push_back(1);
core::list<int> irrB(irrA);
core::list<int> irrC;
irrC = irrA;
I'd recommend changing it, but i'm not sure if there ain't already code in the engine expecting that behavior...