I don't understand why cppcheck shows a constStatement warning (Found a statement that begins with string constant) when I declare a map string->function.
using an initialiser list for map string->int shows no warning, maybe there is something to do with the lambda function that trips cppcheck?
I don't think it should warn me here, the string constants are initialising the map.
Many thanks
Last edit: Marco Paladini 2021-10-27
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I don't understand why cppcheck shows a constStatement warning (Found a statement that begins with string constant) when I declare a map string->function.
sample code that reproduces the warning:
using an initialiser list for map string->int shows no warning, maybe there is something to do with the lambda function that trips cppcheck?
I don't think it should warn me here, the string constants are initialising the map.
Many thanks
Last edit: Marco Paladini 2021-10-27
I fail to reproduce with latest cppcheck. Which version do you use?
oh I have Cppcheck 1.82 on Ubuntu 18.04.
I should have tried the latest version, my bad. Thanks for the help!