-
Notifications
You must be signed in to change notification settings - Fork 141
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
Broken ocl::Path(const Path &) constructor #159
Comments
It seems to be introduced (13 years ago) over here: 5cbe842 And wasn't used, even in the first commit. I think we should probably remove it and enable a compiler flag to show unused variables. |
It does actually seems to be exported to the Python bindings, and other classes seem to have it as well, so perhaps there is / was a reason for it, I am guessing it might have to do with 5cbe842#diff-0616b7317a8086d1a85467f49ed29c5fdbfde09ee5f98ead04bd224d992f8db8R143 |
Never mind, I wasn't aware of C++'s copy constructors, learned something new... so I guess the code makes it more clear / explicit that an shallow copy is "enough"? What is different in your example compared to the shallow copy? |
[Koen Schmeets]
Never mind, I wasn't aware of C++'s copy constructors, learned
something new... so I guess the code makes it more clear / explicit
that an shallow copy is "enough"?
My proposal make a shallow copy, that is correct. I am not sure if it
is enough, nor correct. Perhaps a deep copy is needed? I do not really
know the code enough to tell. Or perhaps copying Path should be
prohibited?
What is different in your example compared to the shallow copy?
I am not quite sure, but suspect it will ensure there are slightly
different span_list contents.
…--
Happy hacking
Petter Reinholdtsen
|
The copy constructor for ocl::Path is a no-op, not copying anything from the source object. Why is it there? As far as I can tell, the code build just fine without the copy constructor. If it is needed and wanted, what about making it a proper copy constructor which make a copy of the content of the source object.
Here is a draft patch removing the copy constructor, and including a simple implementation of the list copying.
The text was updated successfully, but these errors were encountered: