I understand that this may be a duplicate question. However, none of the answers to the relevant questions convinced me.
My question is that: why C++ allows forward declaration of class but not enum?
I understand that if you specify the underlying type of the enum or use enum class in C++, you can forward declare enum type. But why does C++ needs to know the size of underlying type?
enum E;
void foo(E e); // Error
class C
void bar(C c); // Correct, Compiler doesn't know the size of class C either.