'Empty struct in C vs empty struct in C++
Why is empty struct in C a constraint violation? Why does this rule get changed in C++?
Are there any historical reasons?
Solution 1:[1]
My guess is this:
In C, there isn't inheritance, templates, and function overloading - three major reasons we use empty structs in C++ - as a base interface, as a template parameter, as a type to help overload resolution.
Can you think of any real use of an empty struct in C?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Armen Tsirunyan |
