cppcheck icon indicating copy to clipboard operation
cppcheck copied to clipboard

added `constness_ptr` as pointer wrapper to ensure actual method constness

Open firewave opened this issue 2 years ago • 15 comments

firewave avatar Feb 10 '23 10:02 firewave

As ErrorLogger::reportErr() is not const that has a ripple effect.

firewave avatar Feb 10 '23 10:02 firewave

We probably need to do this for references as well.

firewave avatar Feb 10 '23 13:02 firewave

This will all be changed as I am currently trying to get rid of all the unnecessary pointers.

firewave avatar Feb 24 '23 16:02 firewave

@danmar As this seems to become something bigger than a simple wrapper and something that might require to be used in general I would like to develop this externally (i.e. my own work and not part of Cppcheck). It would have a very permissive license but I want to be able to re-use this in the future if necessary and the GPL3 of Cppcheck would prevent that. So I will move this to the external folder.

firewave avatar Mar 09 '23 13:03 firewave

There's std::experimental::propagate_const as pointed out here: https://github.com/llvm/llvm-project/issues/64988#issuecomment-1693881016. Looks quite familiar.

firewave avatar Aug 25 '23 20:08 firewave