Classes: A Deeper Look, Part 2: 2006 Pearson Education, Inc. All Rights Reserved
Classes: A Deeper Look, Part 2: 2006 Pearson Education, Inc. All Rights Reserved
1
0
Classes: A Deeper
Look, Part 2
10.1 Introduction
10.2 const (Constant) Objects and const Member Functions
10.3 Composition: Objects as Members of Classes
10.4 friend Functions and friend Classes
10.5 Using the this Pointer
10.6 Dynamic Memory Management with Operators new and
delete
10.7 static Class Members
10.8 Data Abstraction and Information Hiding
10.8.1 Example: Array Abstract Data Type
10.8.2 Example: String Abstract Data Type
10.8.3 Example: Queue Abstract Data Type
10.9 Container Classes and Iterators
10.10 Proxy Classes
10.11 Wrap-Up
10.1 Introduction
• const objects and const member functions
– Prevent modifications of objects
– Enforce the principle of least privilege
• Composition
– Classes having objects of other classes as members
• Friendship
– Enables class designer to specify that certain non-member
functions can access the class’s non-public members
x = 12
this->x = 12
(*this).x = 12
fig10_20.cpp
(2 of 2)