Byte-Sized-Chunks: C++ Templates and the STL
3.5 (12 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
1,183 students enrolled
Wishlisted Wishlist

Please confirm that you want to add Byte-Sized-Chunks: C++ Templates and the STL to your Wishlist.

Add to Wishlist

Byte-Sized-Chunks: C++ Templates and the STL

Compile-time polymorphism via templates, C++ casts, containers, algorithms and iterators - all will make sense now!
3.5 (12 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
1,183 students enrolled
Created by Loony Corn
Last updated 3/2016
Current price: $10 Original price: $20 Discount: 50% off
5 hours left at this price!
30-Day Money-Back Guarantee
  • 2 hours on-demand video
  • 27 Supplemental Resources
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
What Will I Learn?
  • Confidently use templates - in the form of functions, classes and casts - to write generic C++ code
  • Leverage the power of algorithms, iterators and containers in the STL
  • Understand how templates make the C++ casts so much more powerful than C-style casts
View Curriculum
  • Students should have an understanding of programming - concepts such as variables, loops and if-else statements will not be explained
  • Students should have some basic working knowledge of C++, Java or C#

Note: This course is a subset of our much longer course 'Learn By Example: C++ With 75 Solved Examples' so please don't sign up for both:-)

Like a gruff uncle, C++ seems intimidating, when its just being helpful. These examples will help you understand that.

Let's parse that.

  • C++ seems intimidating because all too often, what you see is not what you get.
  • Usually, that's because C++ is trying to help you, but you don't realise that. C++ is incredibly deep, and it sometimes struggles to get you - the programmer - to understand what it's saying
  • These examples will help. Each is self-contained, has its source code attached, and gets across a specific C++ use-case. Each example is simple, but not simplistic.

What's Included:

  • Templates are a classic generic programming technique that were revolutionary when first added to C++. Understand template functions and classes, as well as template specializations.
  • STL - the Standard Template Library - is incredibly powerful. Get a good sense of collections, iterators and algorithms - the major components of the STL
  • C++ casts are quite different than C-casts. Understand const_cast, static_cast and dynamic_cast, as well as Real Time Type Identification (RTTI), and the manner in which explicit conversions can be performed using static_cast

Using discussion forums

Please use the discussion forums on this course to engage with other students and to help each other out. Unfortunately, much as we would like to, it is not possible for us at Loonycorn to respond to individual questions from students:-(

We're super small and self-funded with only 2 people developing technical video content. Our mission is to make high-quality courses available at super low prices.

The only way to keep our prices this low is to *NOT offer additional technical support over email or in-person*. The truth is, direct support is hugely expensive and just does not scale.

We understand that this is not ideal and that a lot of students might benefit from this additional support. Hiring resources for additional support would make our offering much more expensive, thus defeating our original purpose.

It is a hard trade-off.

Thank you for your patience and understanding!

Who is the target audience?
  • Nope! Please don't enroll for this class if you have already enrolled for our 15-hour course 'Learn By Example: C++ Through 75 Solved Examples'
  • Yep! Java and C# programmers - who understand Object Oriented Programming, but are new to C++
  • Yep! Folks with prior programming experience in C. Some prior object oriented programming experience is recommended
  • Yep! C++ programmers looking to get the little details of templates and the STL exactly right
Students Who Viewed This Course Also Viewed
Curriculum For This Course
15 Lectures
Buzzing Like Bees:Templates!
6 Lectures 44:40

Templates are an awesome way to reuse code in C++. They are the basis of the Standard Template Library, and are a form of compile-time polymorphism.

Templates as a form of generic programming

Just so we wrap our heads around the idea of a function template, and a template parameter.
Preview 09:48

What happens when we wish to override the default template instantiation for some specific type? Its easy!

Example 64: Overriding a default template instantiation

Possibly the most interesting example in this course: a smart pointer class, built using template classes. Smart pointers are used very widely, so you should really make sure to understand this example.
Example 65: A templated smart pointer class

Total and partial template specialisations are not at all as scary or complicated as they sound.
Example 66: Template Specialisation (partial or total)
STL - The Standard Template Library
5 Lectures 42:04
The STL is a little universe of its own, powerful, and elegant. Its really worth your while learning about the STL - it has way too much cool stuff that folks don't use because they find it a bit..intimidating.
Introducing the Standard Template Library

The STL vector class is the most commonly used container, and with good reason.
Example 67: The STL vector

Iterators sound boring ("classes to do stuff, element-by-element with contents of a container") but that bland description belies their power and utility.

Example 68: Iterators

We already explored the vector, which is a sequential STL container - now, let's do some stuff with the map, an associative container.

Example 69: map, an associative container

Algorithms are the most powerful - and least widely used - part of the STL. Let's see how they work. Oh, and did you know that the C++ string is actually an STL container, with some clever typedefs so that you are n't scare off by it?
Example 70: STL algorithms
C++ Casts
4 Lectures 29:56

C++ casts are surprisingly versatile. Understand the 4 types of casts, and how they each differ from old-school C-style casts (which you should entirely stop using, btw)

C++ casts are way cooler than C casts

The const_cast eliminates constness..
Example 71: const_cast

..dynamic_cast is the only safe way to downcast (i.e. to go from base class to derived class). It makes use of the RTTI, C++'s Runtime Type Identification System.
Example 72: dynamic_cast, and RTTI

static_casts are quite smart too - its just that they perform their magic at compile-time, not runtime. Learn how they work with the explicit keyword and make conversions work.
Example 73: static_cast, and the explicit keyword
About the Instructor
Loony Corn
4.3 Average rating
4,954 Reviews
38,834 Students
77 Courses
An ex-Google, Stanford and Flipkart team

Loonycorn is us, Janani Ravi and Vitthal Srinivasan. Between us, we have studied at Stanford, been admitted to IIM Ahmedabad and have spent years  working in tech, in the Bay Area, New York, Singapore and Bangalore.

Janani: 7 years at Google (New York, Singapore); Studied at Stanford; also worked at Flipkart and Microsoft

Vitthal: Also Google (Singapore) and studied at Stanford; Flipkart, Credit Suisse and INSEAD too

We think we might have hit upon a neat way of teaching complicated tech courses in a funny, practical, engaging way, which is why we are so excited to be here on Udemy!

We hope you will try our offerings, and think you'll like them :-)