O'Reilly logo

Sams Teach Yourself C++ in 24 Hours, Third Edition by Jesse Liberty

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Template Items

You can treat template items as you would any other type. You can pass them as parameters, either by reference or by value, and you can return them as the return values of functions, also by value or by reference. Listing 23.2 demonstrates how to pass Template objects.

Listing 23.2. Demonstrating Parameterized Lists
 0: // *********************************************** 1: // FILE: Listing 23.2 2: // 3: // PURPOSE: Demonstrate parameterized list 4: // NOTES: 5: // 6: // COPYRIGHT: Copyright (C) 1997 Liberty Associates, Inc. 7: // All Rights Reserved 8: // 9: // Demonstrates an object-oriented approach to parameterized 10: // linked lists. The list delegates to the node. 11: // The node is an abstract Object type. Three types ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required