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

use assignment by reference instead of pointers #133

Closed
wants to merge 1 commit into from

Conversation

robUx4
Copy link
Contributor

@robUx4 robUx4 commented Dec 29, 2023

No need to dereference a pointer.

No need to dereference a pointer.
Copy link
Contributor

@mbunkus mbunkus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I agree that you can just cast the reference, you don't need to cast for the vast majority of these cases in the first place. Just use elt.SetValue(…) for all those places where the only use is to assign values. The casts are only there from way back when the SetValue() & GetValue() functions didn't exist.

@robUx4
Copy link
Contributor Author

robUx4 commented Dec 29, 2023

Ah, I thought the operator was the preferred way. I had some troubles with it and ending up removing the factorization of those for now. If you think it's better not to have them at all, I can remove them for good.

@mbunkus
Copy link
Contributor

mbunkus commented Dec 29, 2023

We can leave the existing operator <whatever>() in the classes for compatibility purposes, but we should not really use them inside the library anymore. I'd even be fine with removing them altogether, even the member functions themselves.

@robUx4
Copy link
Contributor Author

robUx4 commented Dec 29, 2023

Closing in favor of #136

@robUx4 robUx4 closed this Dec 29, 2023
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