incomplete type

From Cppwiki

Jump to: navigation, search

An incomplete type is a type which is known to exist, but which has not been defined. For example, forward declarations create an incomplete type. Incomplete types can be used to form reference and pointers, but cannot be instantiated and cannot be used as plain types.

 struct T; // T is an incomplete type
 void f (T &a, T *b); // okay, references and pointers to incomplete types are allowed
 void f (T a); // illegal: incomplete types cannot be used as plain types

The void type is a special case of incomplete type which cannot be completed.

Personal tools