void type is and has always been special. This is really incomplete, but is allowed in many contexts where the full type is usually expected. Otherwise, for example, the definition of the void function would be invalid due to the incompleteness of the void type. It is also possible to write expressions of the void type (any call to the void function is an example of such an expression).
Even in C, you can use direct expressions of type void type (void) 0 . What you have in your code is just an example of a C ++ syntax that does almost the same thing: it creates a no-op expression of type void .
source share