lampost
student login button umllogo

UMass Lowell Continuing Studies, Corporate & Distance Education

C++ Templates

2-Day Seminar Offered Once:
CRS# 00.508-041
Dates & Times: TBA, Call 978-934-2495 for more information.

Overview
Prior to the invention of templates, C++ developers often had to write lots of code that looked the same, but worked for different types. For example, sorting integers looked a lot like sorting strings, and a linked list of integers looked a lot like a linked list of strings.

It was tempting to "copy and paste" code to work with yet another type, but that was error-prone, tedious, and often led to the loss of type safety.

A template is a function or a class that works with "a type to be named later". A sorting function template can sort any type, not just integers or strings. A linked list class template can contain any type, not just integers or strings. A template is written once, but is reused many times for many types. Templates are processed by the compiler (not by the preprocessor) at compile-time (not run-time), so they are type safe as well as extremely efficient.

Throughout the seminar, numerous examples will be explained, allowing the student to understand the syntax and semantics of templates. Hands-on lab exercises will reinforce the concepts learned.

Expectations
Upon completion of this seminar, the student will be able to: create their own function, class, and member function templates; use templates to implement smart pointers, variant types, and traits classes; and recognize opportunities for using templates in their current projects.


Audience
The seminar is designed for software developers with at least one year of experience programming in C++. No previous experience with templates or the Standard Template Library (STL) is necessary. Text
Cost of book included in seminar price.

Content

  • Function Template
  • Class Template
  • Member Function Template
  • Template Constraint
  • Template Argument Deduction
  • Full Specialization
  • Partial Specialization
  • Exporting Values, Functions, and Types
  • Smart Pointer
  • Variant Type
  • Traits Class

Note: Course content is partially based on the textbook C++ Templates: The Complete Guide, copyrighted by Addison Wesley 2002.

Instructor
Robert Allan Schwartz has over 26 years of experience in the computer industry, including 15 years of experience writing compilers for BASIC, C, C++, COBOL, FORTRAN, Java, Pascal, PL/I, RPG-II, and 11 years of experience authoring courseware and teaching Object-Oriented Analysis and Design using UML, C, C++ and Java at the beginner, intermediate and advanced levels.

Back to Corporate Signature Seminar Series