Uh oh!
There was an error while loading. Please reload this page.
added constness_ptr as pointer wrapper to ensure actual method constness - #4785
added constness_ptr as pointer wrapper to ensure actual method constness#4785firewave wants to merge 1 commit into
constness_ptr as pointer wrapper to ensure actual method constness#4785Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
firewave
commented
Aug 25, 2023
There's |
firewave
commented
Nov 12, 2024
We do not have many pointer left in the code so this should be taking a reference now. |
35a740b to
d193431Comparefirewave
commented
Apr 14, 2025
I will tackle references later on - let's start with the pointers which are not supposed to be references yet. |
danmar
commented
Apr 15, 2025
I don't really understand what we achieve with this |
From https://en.cppreference.com/w/cpp/experimental/propagate_const: |
firewave
commented
Apr 15, 2025
The name is misleading though. I think this started as something totally different. Not sure what to call it - |
I feel a bit skeptic about this spontanously. But yeah some name that indicates that const is propagated sounds good. But at the same time it shouldn't be too long. I wonder how people would feel about a cppcheck checker that tells them about accessing non-const member data using const pointers. Spontanously it seems wrong to do that and I could use that in our selfchecks at least. or do you know a use case when we would want to write such data? I considered such a checker a long time ago but I dropped the idea for some reason. I don't remember why. But I guess it was simply because of limited time and there are plenty of undefined behavior to discover so I rather wanted to work on that. |
firewave
commented
Apr 17, 2025
https://trac.cppcheck.net/ticket/11127 Not really a use case but something which will cause a lot of On a side note I wonder if there is a simple trick to propagate that a function should not be |
firewave
commented
Apr 22, 2025
I renamed it |
safe_ptr as pointer wrapper to ensure actual method constnessconstness_ptr as pointer wrapper to ensure actual method constnessdanmar
commented
May 6, 2025
I like that name better. |
firewave
commented
Sep 24, 2025
I implemented it in simplecpp - see cppcheck-opensource/simplecpp#548. |
No description provided.