PDC05: Day Two (C++/CLI Object Model Intro)
Stanley Lippman (blog) once again opened the C++ pre-conference session by leading us on a historical tour of the C++ Object Model. He contrasted the two original styles of vtbl architectures: STVM (Stroustrup) and KVTM (Kay). The former style uses the familiar static dispatch of C++, while the latter uses the dynamic dispatch of languages like Smalltalk and Objective-C. Lippman did a good job of being both informative and entertaining using the line "Well, I won't event get into it." whenever he was about to say something he ought not.
The need to support C++/CLI required the team to use a new dispatching system (SVTM or Stub VTbl Model), which we will learn more about later today. The next decision for the team was how to integrate the new CLI references into C++. For designating that typename T is a reference, they saw three possible options:
- Use the normal T* type
This option appeared to create more problems than it solved. For instance, what would T** mean in that context? - Create a a library to support CLI types
This was the tradition C++ answer from the old Bell Labs days - Change the language and add a new symbol
This is the option they selected and created the new symbol T^ (called a "hat") representing a pointer-style reference and T% (what is this called?) representing a C++ reference-style reference. Remember that a C++ reference cannot be NULL and cannot be changed once set.
- 1988 - multiple inheretance
- 1991 - generic programming
- 1996 - ISO C++
- 2005 - dynamic programming (C++/CLR)
0 Comments:
Post a Comment
Links to this post:
Create a Link
<< Home