You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 21, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -471,6 +471,21 @@ Lambda expression provides a wrapping for functions to make it takes the require
471
471
- `bind`
472
472
473
473
474
+
## Forward Declaration
475
+
The *forward declration* `class StrBlob;` introduces the name `StrBlob` into the program and indicates that it's a class type. **After the declaration and before a definition is seen, the class is a incomplete type:** it is know that `StrBlob` is a class type but what members the type contains is unknown.
476
+
477
+
We can use a incomplete type only in limited ways:
478
+
1. we can define pointers or references to such type.
479
+
2. We can declare, but not define, functions using the incomplete type as return or parameter type.
480
+
481
+
A class must be defined before:
482
+
1. we can create object of that type, otherwise the compiler does not know how much memory to allocate for the object.
0 commit comments