-
Notifications
You must be signed in to change notification settings - Fork 155
Description
In qhexedit.h at lines 346 and 349, member functions are declared like this:
void setHexCaps(const bool isCaps);
//...
void setDynamicBytesPerLine(const bool isDynamic);
The functions are implemented in qhexedit.cpp at lines 317 and 328.
Since the argument is passed by value, it has no effect to declare them const since the function body receives a copy of the argument, anyway. They should be declared simply as bool.
There is an interesting discussion of this practice on StackOverflow. Another (IMHO) excellent discussion by Herb Sutter is available here
Personally, I think that only arguments of pointer or reference type need it. But from reading the discussion, it seems like this is more a matter of philosophy, or (bad?) style with many developers out there who insist on using it.
If it is more for "self-documentation of source code", as some have suggested, what is it supposed to document?