Take
Exercise 2 from Chapter 6, and add an inline constructor, and an inline member
function called
print( )
to print out all the values in the array.
Take
the
NestFriend.cpp
example from Chapter XX and replace all the member functions with inlines. Make
them non-
in
situ
inline functions. Also change the
initialize( )
functions to constructors.
Take
the
nl.cpp
example from Chapter XX and turn
nl
into an
inline
function in its own header file.
Create
a class
A
with
a default constructor that announces itself. Now make a new class
B
and put an object of
A
asa
member of
B,
and give
B
an inline constructor. Create an array of
B
objects and see what happens.
Create
a large quantity of the objects from Exercise 4, and use the
Time
class to time the difference between a non-inline constructor and an inline
constructor. (If you have a profiler, also try using that.)