EASTL icon indicating copy to clipboard operation
EASTL copied to clipboard

Fixing issue with list ctor that differs from stl (wasn't documented)

Open RisingLiberty opened this issue 2 years ago • 2 comments

(https://en.cppreference.com/w/cpp/container/list/list) constructor 4) dictates: "Constructs the container with count default-inserted instances of T. No copies are made." However, EASTL created a default constructed object which would then be copied into the nodes. No default object is constructed now and the parameter-less overload of DoCreateNode is now used to create the nodes.

RisingLiberty avatar May 23 '22 20:05 RisingLiberty

Hello,

Thanks for the PR, what's here looks good to me but it looks like we don't have a CLA for you on file yet. Could you please fill out this form?

Also, it'd be good to have a test to TestList.cpp verify that the "No copies are made" part of the contract is satisfied. You should be able to verify this via TestObject::sTOCopyCtorCount.

grojo-ea avatar Jul 23 '22 00:07 grojo-ea

@grojo-ea I've added the tests and filled in the CLA now. Let me know if there's anything else you need

RisingLiberty avatar Nov 18 '22 15:11 RisingLiberty