O'Reilly logo

Object-oriented Programming Using C++ and Java by Anand Vasappanavara, Gautam Vasappanavara, Ramesh Vasappanavara

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

14

Generic Programming and Templates

LEARNING OBJECTIVES

At the end of this chapter, you should be able to understand

  • Using template classes employing template class member functions as well as non-template class member functions.

  • Use type-specific friend functions and static member function and data.

  • Use generic programs extensively for data structure implementation such as stack.

  • Appreciate concepts of developing template libraries.

14.1 Introduction

Generic programming means writing programs that will work for any type of data, i.e. make the programs independent of the type of data. With generic programs, there will be no need to develop type-specific programs for each data type. Templates in C++ are implementation tools provided to ...

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