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

Suggestion for issue #1108 #1122

Merged
merged 2 commits into from Jan 26, 2018

Conversation

Projects
None yet
3 participants
@svart-riddare
Contributor

svart-riddare commented Nov 23, 2017

Solves #1108. The default copy constructor of GenericPointer will use the allocator of the copied object. The extra copy constructor that takes an allocator as a parameter is distinct if someone really wants to create a copy with a null allocator.

See  #1108 for details and other possible solutions.

Solves #1108. The default copy constructor of GenericPointer will use…
… the allocator of the copied object. The extra copy constructor that takes an allocator as a parameter is distinct if someone really wants to create a copy with a null allocator.
@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls Nov 23, 2017

Coverage Status

Coverage increased (+0.003%) to 99.919% when pulling 86e280f on svart-riddare:issue-1108 into 17ae6ff on Tencent:master.

coveralls commented Nov 23, 2017

Coverage Status

Coverage increased (+0.003%) to 99.919% when pulling 86e280f on svart-riddare:issue-1108 into 17ae6ff on Tencent:master.

@miloyip

This comment has been minimized.

Show comment
Hide comment
@miloyip

miloyip Nov 27, 2017

Collaborator

Can you also add an unit test for enforcing this proposed behavior?

Collaborator

miloyip commented Nov 27, 2017

Can you also add an unit test for enforcing this proposed behavior?

@svart-riddare

This comment has been minimized.

Show comment
Hide comment
@svart-riddare

svart-riddare Nov 27, 2017

Contributor

Unit tests added, for copy constructor and assignment operator. As you will seen, the two tests added emphasize the fact that the copy constructor reuses the allocator of the copied object but not the assignment operator (that was option 1 in my comment on issue #1108).

Of course, we can also implement option 2, in which the copy constructor and the assignment operator have the same behavior regarding the allocator.

Whichever you prefer.

Contributor

svart-riddare commented Nov 27, 2017

Unit tests added, for copy constructor and assignment operator. As you will seen, the two tests added emphasize the fact that the copy constructor reuses the allocator of the copied object but not the assignment operator (that was option 1 in my comment on issue #1108).

Of course, we can also implement option 2, in which the copy constructor and the assignment operator have the same behavior regarding the allocator.

Whichever you prefer.

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls Nov 27, 2017

Coverage Status

Coverage increased (+0.003%) to 99.919% when pulling 44f2f9a on svart-riddare:issue-1108 into 17ae6ff on Tencent:master.

coveralls commented Nov 27, 2017

Coverage Status

Coverage increased (+0.003%) to 99.919% when pulling 44f2f9a on svart-riddare:issue-1108 into 17ae6ff on Tencent:master.

@miloyip miloyip merged commit 7641af6 into Tencent:master Jan 26, 2018

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.003%) to 99.919%
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment