You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Remove superfluous const parameters from function declarations #105
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:
As discussed in discord.
I would like to keep const in hpp/cpp to be consistent. Or does it absolutely not make sense at all (i am not really convinced by the attached SO, as in it shows intent, and doesnt really "pollute" anything)?
Activity
deccer commentedon Mar 29, 2022
As discussed in discord.
I would like to keep const in hpp/cpp to be consistent. Or does it absolutely not make sense at all (i am not really convinced by the attached SO, as in it shows intent, and doesnt really "pollute" anything)?