added `constness_ptr` as pointer wrapper to ensure actual method constness
As ErrorLogger::reportErr() is not const that has a ripple effect.
We probably need to do this for references as well.
This will all be changed as I am currently trying to get rid of all the unnecessary pointers.
@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.
There's std::experimental::propagate_const as pointed out here: https://github.com/llvm/llvm-project/issues/64988#issuecomment-1693881016. Looks quite familiar.