Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

RisingLiberty
Copy link

(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.

…e T which would then be copied over while the standard says that no copies are made
if the function was called with arithmetic type, the value would not be zero initialized.
@grojo-ea
Copy link
Contributor

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.

@RisingLiberty
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants