Quick overview
Templates Presentation,
pptx
Templates are one of the terrific features of the C++ language. They are the basis of the Standard
Template Library (STL) and are useful in day-to-day programming.
Template Code Examples
Basic and some more advanced template examples.
Template Techniques
Illustrates syntax and also provides examples of template specialization.
Variadic Templates
Illustrates use of variadic function templates, variadic class templates, and shows one way to implement tuple.
Properties
Templates help us provide properties for C++, not supported by the native language.
Simple Demo of Callable Objects
Look at this demo first. Illustrates first look at function pointers, functors, and lambdas.
Functor examples
Shows how templates and functors can help make code flexible.
Demonstrate several useful variations of Callable Objects
Illustrates callable objects: pointers to global functions, pointers to member functions, functors, and lambdas.
Template Functors and Invokers,
Function Objects CodeSnap,
LambdaCapture CodeSnap
These demos illustrate function objects - functions, function pointers, functors, and lambdas.
Simple demos for all of the STL Containers
Code for Array, Deque, List, Map, Native array, Queue, Set, SingleList, Stack, String, UnorderedMap, UnorderedSet, and Vector.
STLContainers examples
This code, linked on earlier slides,
contains a simple example of the new Variadic Template functionality in the "inserter" project.
Also includes functors, algorithms, and several other things you need to know.
Smart Pointers with Reference Counting
Smart pointers are useful tools, especially for holding onto heap resources indexted through an STL container.
They are also a great illustration of many of the Template Techniques we've discussed in this course.
Excellent C++ Q&A - Marshall Cline and Bjarne Stroustrup,
Excellent Templates Q&A
If you are only going to go one place to find information to supplement class texts and notes,
then go here!