Reference and value semantics: C++ versus everything else

C++ treats pointers differently than other object-based languages, such as Object Pascal or Smalltalk. C++ is value based and treats classes like primitive types, whereas Object Pascal and Smalltalk are reference based (assignment means copying a pointer) and treat objects very differently from primitive types. This is a benefit of C++, because it handles all types in the same style, as opposed to multiple styles in Object Pascal (Smalltalk, like C++, is also self-consistent). However, there are some implications for your C++ programming style.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker