VVZ API is not affiliated with ETH Zurich. Data might be outdated or incorrect. Please view the official ETHZ Vorlesungsverzeichnis for binding information.

251-0233-00L 5 Credits

C++ Templates and Generic Programming

C++ Templates and Generic Programming (in English)

Lecturers & Examiners: PD Dr. Evgueni Zouev
VVZ CR n/a

Last Updated: 2026-02-05 14:59:55

Abstract

Introduction into generic programming (GP), a modern programming paradigm, supported by many programming languages. It gives an overview of the C++ template mechanism which is a basis of GP in C++. The STL library is presented. Key STL and GP concepts like iterators, containers and algorithms are considered together with many practical examples illustrating different GP-based techniques.

Objective

At the end of the course, the listeners will: - Know the basic template mechanisms in the C++ language; - Be able to use templates in practical C++ programming; - Know the basic principles of generic programming; - Know STL library and its basic concepts (containers, algorithms, iterators); - Be able to use STL for practical programming.

Content

- The basics of template mechanism in the C++ language; the concepts of template function, template class, template instantiation, and template specialization. - The kinds of template parameters: type and non-type parameters, parameters-templates. - Explicit and implicit template specialization. - Partial specialization; member templates. - Metaprogramming technique with templates. - Functional objects; expression templates. - Introduction to generic programming: containers, iterators, algorithms. - Introduction to STL library - Overview and analysis of STL library: kinds of iterators and containers, algorithm examples. - Advanced STL tools: allocators, traits, functional types and objects. - Program examples with STL.

Resources

Literature

- International Standard - Programming Languages - C++, ISO/IEC 14882, 1998 (E), Draft C++ Standard (publicly available) of December 1996.www.cygnus.com/misc/wp/dec96pub - B. Stroustrup: The C++ Programming Language, Third Edition, AT&T 1997. - Leen Ammeraal: STL for C++ Programmers, JohnWiley and Sons, 1996, ISBN: 0471971812

General Information

Language
English
Frequency
Yearly recurring

Examination

Type
session examination
Mode
oral 15 minutes

Course Components

Type Title Time & Place Hours
lecture C++ Templates and Generic Programming (in English)
  • Tue 13:15-15:00 (IFW A 36)
2 h weekly
exercise C++ Templates and Generic Programming (in English)
  • Tue 15:15-16:00 (IFW A 36)
1 h weekly

Offered In