C++ Templates and the STL
Introduction
C++ added two powerful new programming styles to C. The first and most famous is object-orientation, and the second is template-based programming, sometimes known as generic programming. Although templates are covered in our basic C++ courses, the focus there tends to be on how the needs of object-oriented C++ are satified by library provisions that are frequently template-based, so this separate course is offered as a supplement. There is a second purpose to this course: to cover, in detail, the template classes and template functions of the standard library (known historically as the Standard Template Library or STL). These offer a powerful illustration of template design and most people will find that they need them at some time or other.
Duration and Construction
The course lasts one day, starting at 09.30 and finishing at 17.00. The delivery is via lecture, discussions and practical exercises.
Intended Audience
Participants should already have a good knowledge of C++ and object technology. Ideally they will have attended the Advanced C++ (C++ Traps and Pitfalls) course.
Aims
- To understand how templates provide type-safe, reusable code
- To understand C++'s template facilities
- To understand the differences between, and synergy between, generaic (template-based) programming and object-orientation
- To become familiar with the elegant and powerful examples of template design provided by the Standard Template Library
- To beome aware of the provisions of the Standard Template Library (STL), including containers, iterators, algorithms, function objects, predicate function objects and adapters
Deliverables
- Lectures
- Facilitation of discussions
- Direction, assistance and feedback in practicals
- Proposed solutions to the practicals
- Copies of lecture slides, plus explanatory text and summaries
- Reference list of books and sources
Numbers
We recommend that there are no more than 10 participants, with the best results usually obtained when there are at least 5 participants.
Contents
- The difficulties of efficiently coding true abstract data types in a type-safe manner
- Template classes
- Template functions
- Template member functions
- The auto_ptr template class
- The organization of the STL
- Performance and the STL
- The STL containers
- The STL iterators
- The STL algorithms
- Function objects and predicate function objects
Site Requirements
- One PC with Visual C++ (version 6 or .NET), per participant (including one for the lecturer), preferably networked and with a printer
- Data projector of at least 1024 x 768 resolution, and suitable screen
- White-board, preferably not doubling up as the OHP's screen; blackboard and chalk are acceptable
- Flip-chart and easel, with additional flip-chart paper
Contacting
Please contact Matrice by telephone on +44 7010 704705; by fax on +44 7010 704706; by emailing bookings@matrice.co.uk; or by visiting http://www.matrice.co.uk
Questions or problems regarding this web site should be
directed to webmaster@matrice.co.uk.
Copyright © 2005 Matrice. All rights reserved.
Last modified:
Tuesday, 07-Jun-2005