Semicolon after Function

后端 未结 6 1590
广开言路
广开言路 2021-02-18 12:57

Is there a specific reason why some people put a semicolon after the curly closing function bracket?

void foo() {

};
6条回答
  •  半阙折子戏
    2021-02-18 13:48

    You have to ask the specific people. But if I had to guess: in C++ there are situations, when you have to put semicolon after }, like class, enum, struct - so maybe some people put it always, because they don't want to remember when it is necessary.

提交回复
热议问题