Skip to content

Conversation

sumir0
Copy link
Contributor

@sumir0 sumir0 commented Sep 20, 2025

  • Add const keyword to function parameters which are not meant to be modified inside the function in correspondence estimation classes

  • Add const keyword to local variables which are not meant to be modified in correspondence estimation classes except for variables in clone() functions

Background

I was looking into #329, #4901, and other when noticed some variables and parameters not being const. So I decided to "improve" the code when I had an opportunity.

Variables in clone() functions

I didn't change constness of variable copy in clone() functions because I am just unsure about NRVO in this case. Maybe I should have added const in these cases. But that can be done later anyway.

About const function parameters passed by value

There are multiple opinions on the usage of const with function parameters passed by value in the C++ community. I used const with function parameters in this pull request to prevent mistakes when a parameter is modified inside the function but should not be. We can discuss it and const in function declarations and etc. further if you need or want to.

P.S.

I also noticed other non-critical things but, probably, I should try to prioritize tasks to do more important contributions.

* Add const keyword to function parameters which are not meant to be
modified inside the function in correspondence estimation classes

* Add const keyword to local variables which are not meant to be
modified in correspondence estimation classes except for variables in
clone() functions

Signed-off-by: Ramir Sultanov <sumir0@proton.me>
@sumir0 sumir0 force-pushed the correspondence-estimation-with-some-const-guards branch from 7b7e02c to ecb2a96 Compare September 21, 2025 11:46
@sumir0
Copy link
Contributor Author

sumir0 commented Sep 21, 2025

I am sorry for the force-push after opening the pull request. Let's wait for the pipeline to finish. After that the changes can be reviewed I think.

@larshg larshg added module: registration changelog: enhancement Meta-information for changelog generation labels Sep 24, 2025
@larshg larshg added this to the pcl-1.16.0 milestone Sep 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: enhancement Meta-information for changelog generation module: registration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants