Sorry in advance, which is probably a dumb question, but in C ++ classes, why the semicolon after the closing curly brace? I regularly forget about it, get compiler errors, and therefore lose time. It seems to me somewhat unnecessary, which is unlikely to be the case. People really do something like
class MyClass { . . . } MyInstance;
Edit: I get it from the C compatibility point for structures and enumerations, but since classes are not part of the C language, I assume that in the first place there is consistency between similar declaration constructions, What I was looking for was more related to the design rationale and not with the ability to change anything, although a good code completion IDE may prevent this from happening before compilation.
c ++ oop class declaration semicolon
Shane MacLaughlin Apr 24 '09 at 12:47 2009-04-24 12:47
source share