For non-reference, non-pointer function prototype parameters, const is superfluous and has no effect. It only serves to clutter the API and does not provide any guarantee to the caller. See this SO answer for more info.
Suggestion: remove const from non-reference, non-pointer-like parameters in function declarations, and keep them in function definitions to maintain const-correctness where it matters, for example:
class DearImGuiApplication final : public Application
{
public:
...
void OnResize(
int32_t width,
int32_t height) override;
...
};
void DearImGuiApplication::OnResize(
const int32_t width,
const int32_t height)
{
...
}
The other place I have noticed this issue is with the std::string_view parameter of Application's (and its derivatives') constructor.
For non-reference, non-pointer function prototype parameters,
constis superfluous and has no effect. It only serves to clutter the API and does not provide any guarantee to the caller. See this SO answer for more info.Suggestion: remove
constfrom non-reference, non-pointer-like parameters in function declarations, and keep them in function definitions to maintain const-correctness where it matters, for example:The other place I have noticed this issue is with the
std::string_viewparameter ofApplication's (and its derivatives') constructor.