Sming
Sming copied to clipboard
Please add 'const' to class member functions that are not modifying the object
Example I bumped into, just now: DateTime::toShortDateString() Code does not change internal state of the object, so it should be declared as 'const', so that I'm allowed to use it on a 'const DateObject&'.
I think most of DateTime functions should be const.
Thank you.
@cr1st1p Can you make a PR with the suggested changes?
-Wsuggest-attribute=const might help to find any functions that are candidates.to be marked const.
For the use of "const" we should make the changes across the whole Sming Framework classes and not just here and there. A "const" change should be merged with that PR #1384.