www.easyCPlusPlus.com

Easy C++

www.easyCPlusPlus.com

STL Tutorial

Welcome to EasyCPlusPlus's STL Tutorial. This tutorial features a series of lessons covering all parts of the Standared Template Library, STL. It covers containers, iterators, generic algorithms, function objects and adapters.

Overview
Learn About the Standard Template Library. This lesson introduces the major parts: containers, iterators, generic algorithms, function objects and adapters.

STL Tutorial - Lesson 2: Sequence Containers
This lesson covers sequence containers. Sequence containers hold elements of a single type as a linear sequence. That is, they are ordered in the same way as they are added to the container. The STL provides three sequence containers: vector, deque and list. In addition, arrays, which are a built-in part of the language and the string class, which is part of the standard library, may be used as sequence containers.

STL Tutorial - Lesson 3: Associative Containers
The associative containers are specialized to allow the fastest possible retrieval (or look up) of values. This retrieval is either by the values themselves or by a key, where each value has its own key. There are four standard associated containers that will be part of any implementation of the standard C++ library: set, multiset, map and multimap.

STL Tutorial - Lesson 4: Function Objects
Many of the generic algorithms and a few methods of some of the container classes accept an additional parameter that can modify the behavior of these functions in useful ways. This additional parameter is a function object or an ordinary function. A function object is an instance of a class that has the function operator, operator(), overloaded.

STL Tutorial - Lesson 5: Generic Algorithms, Part 1
This is the fifth lesson in the C++ STL tutorial. It presents and explains the generic algorithms of the STL. Accumulate, adjacent_difference, adjacent_find, binary_search, copy, copy_backward, count, equal, equal_range, fill, find and for_each are discussed. The necessary include files to use the STL are also covered.

STL Tutorial - Lesson 6: Generic Algorithms, Part 2
This is the sixth lesson in the C++ STL tutorial. It presents and explains the generic algorithms of the STL. Includes, inner_product, max, max_element, merge, min, min_element, mismatch, partition, remove, replace and reverse are discussed.

STL Tutorial - Lesson 7: Generic Algorithms, Part 3
This is the seventh lesson in the C++ STL tutorial. It presents and explains the generic algorithms of the STL. Search, search_n, set_difference, set_intersection, set_symmmetric_difference, set_union, sort, swap, transform and unique are discussed.