Beautiful C++: STL Algorithms

Very few C++ developers know the time and effort they could save with the algorithm header of the Standard Library. This course unlocks that header by connecting tasks you need to perform to the single line of code from the STL to do them.
Course info
Rating
(142)
Level
Intermediate
Updated
Jun 30, 2016
Duration
4h 24m
Table of contents
Course Overview
Standard Library Philosophy and Approach
Counting and Finding
Sorting
Comparing and Accumulating
Generating and Manipulating Collections
Using the Power of Iterators
Unexpectedly Useful Operations
Conventions
Description
Course info
Rating
(142)
Level
Intermediate
Updated
Jun 30, 2016
Duration
4h 24m
Description

If you're a C++ developer, save yourself valuable time and work by learning how to use the algorithm header. In this course, Beautiful C++: STL Algorithms, you'll learn the functions in the algorithm header. You'll find out how iterators multiply the power of the library. Next, you'll learn the conventions that lower your mental burden. Finally, you'll learn how to use the same algorithm with different collections so you don't have to learn new functions. After this course, you'll know what the algorithm header has to offer you and how to use it to your advantage while developing.

About the author
About the author

Kate Gregory is in her fourth decade of being paid to program. Her firm, Gregory Consulting Limited, is based in rural Ontario and helps clients adopt new technologies and adjust to the changing business environment. Current work makes heavy use of .NET and Visual C++ for both web and client development, especially for Windows 7 and 8. Managing, mentoring, technical writing, and technical speaking occupy much of her time, but she still writes code every week.

More from the author
C++ Fundamentals Including C++ 17
Beginner
5h 48m
6 Mar 2018
More courses by Kate Gregory
Section Introduction Transcripts
Section Introduction Transcripts

Course Overview
Hi everyone. My name is Kate Gregory, and welcome to my course, Beautiful C++: STL Algorithms. I run a small consulting firm, Gregory Consulting, writing code for some of my clients and helping others to be better developers. I've been writing C++ since the late 80s, and these days a lot of people ask me to help them be better C++ developers. It's one of my favorite languages, and one that's worth learning to use well. C++ has had a standard library for as long as there's been a C++ standard, but many developers use it as little as possible for a variety of reasons. In this course, I'll show you there's nothing to fear about algorithms and iterators, and you'll be ready to start saving a lot of development time while you write better code. Some of the major topics we'll cover include the functions in the algorithms header, almost 100, sorting, finding, comparing, generating, and much more, how iterators multiply the power of the library, the conventions used in functions, names, and parameters that lower your mental burden, and how to use the same algorithm with different collections so you don't have to learn new functions. By the end of this course, you'll know what the algorithm header has to offer you and how to use it. You won't be afraid of iterators, and you'll know when a lambda brings you the complete control you need. You'll be able to write code that clearly expresses your intent, handles more edge cases, and is typically faster than what you would have written yourself. Before beginning the course, you should be familiar with C++, having written and debugged some code. It doesn't matter what IDE compiler or other tools you use, I'll demonstrate in Visual Studio, but you can use your own system. My C++ Fundamentals course covers all the background you need. I hope you'll join me on this journey to learn how to save development time while writing fast and powerful code everyone can read with the Beautiful C++: STL Algorithms course here at Pluralsight.

Standard Library Philosophy and Approach
Hi, I'm Kate Gregory. Welcome to Beautiful C++: STL Algorithms. I want you to learn this powerful and useful library so you can reduce development time while writing code that performs better and expresses your intent clearly. I really want to emphasize that. This isn't about a tradeoff where you accept poor performance or hard-to-read, obscure, arcane code in order to achieve a little bit of time saving in development time. This is about saving development time, writing code other people can read, writing code that's fast, and writing code that makes sense. No tradeoffs. Now in this module, I'm going to start by explaining some of the philosophy behind the standard library. Most of us call that STL, because its original name was the standard template library. Now there's a lot more to the library than the algorithms header, but there's more than enough in that one header to fill this course.

Counting and Finding
Hi, welcome back to Beautiful C++: STL Algorithms. I want you to learn this powerful and useful library, so you can reduce development time while you write code that performs better, and expresses your intent clearly. No trade-offs. In this module, I want to start with a really simple set of needs, finding particular elements in a collection, or counting how many times elements in a collection occur. There are a lot of functions in the algorithm header to help with this kind of work, and you'd be surprised how simple they are to use and how many of the things you think you need to write loops for have already been taken care of.

Sorting
Hi, welcome back to Beautiful C++: STL Algorithms. I want you to learn this powerful and useful library, so you can reduce development time while you write code that performs better and expresses your intent clearly. In this module, you'll see how the function called sort and the number of related functions can save you from having to dig out those old textbooks to remind yourself how to code some loops yourself. Trust me, you can't write a fast and efficient sort that's correct, at least not on your first try, and there's no reason why you should have to take any tries.

Comparing and Accumulating
Hi, welcome back to Beautiful C++: STL Algorithms. I want you to learn this powerful and useful library so you can reduce your development time while you write code that performs better and expresses your intent clearly. In this module, you'll meet a number of functions from the algorithm header that help you deal with the contents of collections or parts of collections, and these are just the sort of things most people write loops to do and shouldn't. The only reason you write your own loop is you didn't know there was a function waiting for you that would do what it is that you're trying to do.

Generating and Manipulating Collections
Hi, welcome back to Beautiful C++: STL Algorithms. I want you to learn this powerful and useful library, so you can reduce development time while you're writing code that performs better and expresses your intent more clearly than more complicated difficult stuff you would have written yourself. In this module, I'll show you how to make collections do what you want, copying, transforming, generating them, just taking control instead of writing loops yourself. And as always, the algorithms I'll show you work with a variety of collections.

Using the Power of Iterators
Hi, welcome back to Beautiful C++: STL Algorithms. I want you to learn this powerful and useful library so you can reduce development time while you write code that performs better and expresses your intent clearly. The best of all worlds. In this module, it's time to draw back the curtain on iterators. They multiply the number of things you can do with the algorithms you've seen so far. By learning a few iterators, suddenly you know twice, four times, maybe eight times as many algorithms as you did before. It's incredibly rewarding, and it's key to getting the full value from the algorithm header.

Unexpectedly Useful Operations
Hi, welcome back to Beautiful C++: STL Algorithms. I want you to learn this powerful and useful library so you can reduce development time while you write code that performs better and expresses your intent clearly. In this module, I want to take a moment to show you some algorithms whose names and descriptions really don't do them justice. You may not be able to tell from their names what they're for, but they are probably just what you occasionally need. Once you're in the secret club of knowing them, you'll be a lot more productive.

Conventions
Hi, welcome back to Beautiful C++: STL Algorithms. I want you to learn this powerful and useful library so you can reduce your development time while you write code that performs better and expresses your intent clearly. No trade-offs. One of the things you don't immediately notice about the standard library is how consistent it is. There's a pattern in the names of functions, in the order of the parameters, even in the types of parameters that functions take. Why do you care? Because it makes your life easier.