In C++, why does the following struct definition reports "field has incomplete type" error:
struct Element {
Element* prevPtr = nullptr, nextPtr = nullptr;
};
while the second definition works fine:
struct Element {
Element* prevPtr = nullptr;
Element* nextPtr = nullptr;
};
It seems the second pointer cannot be defined together with the first pointer (separated by a comma). Why is that?