Why comment parameter names rather than leave it as it is

前端 未结 6 671
隐瞒了意图╮
隐瞒了意图╮ 2021-01-02 10:03

Sometimes I see code like this:

LRESULT OnPaint(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)

Why comment pa

6条回答
  •  自闭症患者
    2021-01-02 10:10

    Some compilers wouldn't issue a "unused argument warning" when you comment the argument or not provide it in the first place. But of course you would need to leave the type to have the correct signature.

提交回复
热议问题