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

Refactor all code to use QSharePointer and std::vector #205

Merged
merged 18 commits into from
Aug 8, 2021

Conversation

ftylitak
Copy link
Owner

@ftylitak ftylitak commented Aug 7, 2021

Code base was extensivelly using classes: Ref, Counted as a way for reference counted pointers. These classes where replaced by the use of QSharedPointer
Moreover, Array and ArrayRef were replaced by std::vector and QSharedPointerstd::vector.

This PR resolves all warnings/errors produced by Vlargind.

Also, it could solve issues: #202 & #61

@lgtm-com
Copy link

lgtm-com bot commented Aug 7, 2021

This pull request introduces 7 alerts when merging 0f768f9 into 8a36df7 - view on LGTM.com

new alerts:

  • 7 for Multiplication result converted to larger type

@ftylitak ftylitak merged commit 9f7a1ac into master Aug 8, 2021
This was referenced Aug 8, 2021
@StefanoD
Copy link
Contributor

StefanoD commented Dec 11, 2022

Question: Why did you decide to use QSharedPointer instead of std::shared_ptr?
Strange is also the use of QSharedPointer<std::vector>, because here you could use QVector which is a COW data structure. That is, is does a shallow copy per default and a real copy happens only when it gets modified.

@ftylitak
Copy link
Owner Author

Hello @StefanoD

QSharePointer was only used for compatiblity with Qt, just in case someone use the library with C++ earlier than 11.

For the QVector, you are right and it should be done as you say.

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.

2 participants