GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||
GeezerVison is showing github.com — added `constness_ptr` as pointer wrapper to ensure actual method constness by firewave · Pull Request #4785 · cppcheck-opensource/cppcheck Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Collaborator
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Collaborator
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
firewave
force-pushed
the
safe_ptr
branch
2 times, most recently
from
35a740b to
d193431
Compare
firewave
marked this pull request as ready for review
Collaborator
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Collaborator
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
|
From https://en.cppreference.com/w/cpp/experimental/propagate_const: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The name is misleading though. I think this started as something totally different. Not sure what to call it - |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
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. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
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 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I renamed it |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
safe_ptr as pointer wrapper to ensure actual method constnessconstness_ptr as pointer wrapper to ensure actual method constness
I like that name better. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I implemented it in simplecpp - see cppcheck-opensource/simplecpp#548. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.