Function argument can be made const not working for pointers Follow
Feature request: Pointer argument can be made const
Given the following function:
Snippet
void foo (int * bar, int baz) { *bar = 2 * baz; }
Then R++ correctly proposes that baz can be made const. (a new feature (?) that I really appreciate)
However, R++ fails to also propose that bar can be made const like such:
Snippet
void foo (int * const bar, int const baz)
Snippet
As I rarely assign a new pointee to a pointer almost all my pointers can (and should) be made const.
This is different from pointer to const, e.g., int const * bar
Please sign in to leave a comment.
Hello Matthaeus,
Please vote for https://youtrack.jetbrains.com/issue/RSCPP-20199.
Thanks, did as you asked.
Sorry for having posted in the wrong location.
It's totally ok, that's what the forum is for :) We discussed this internally some time ago and were divided whether this is worth implementing, but now maybe we'll add an inspection that detects non-const pointers.