Incomplete type for std::vector
问题 The GCC compiler complains (see below) when I try the following. class Face needs to be incomplete because it contains pointer to class Element which similarly contains pointer to class Face . In other words, there is a circular dependency among classes. How can I fix it? error: invalid application of ‘sizeof’ to incomplete type ‘Face’ class Face; // needs to be incomplete class Element { std::vector < std::unique_ptr <Face> > face; }; class Face { std::vector < std::unique_ptr <Element> >