Using void in functions without parameter?

前端 未结 5 1003
说谎
说谎 2021-02-19 07:44

In C++ using void in a function with no parameter, for example:

class WinMessage
{
public:
    BOOL Translate(void);
};

is redunda

5条回答
  •  孤街浪徒
    2021-02-19 08:46

    Just as a side note. Another reason for not including the void is that software, like starUML, that can read code and generate class diagrams, read the void as a parameter. Even though this may be a flaw in the UML generating software, it is still annoying to have to go back and remove the "void"s if you want to have clean diagrams

提交回复
热议问题