Byte-Sized-Chunks: C++ Templates and the STL
3.7 (6 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.
95 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.7 (6 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.
95 students enrolled
Created by Loony Corn
Last updated 3/2016
Current price: $10 Original price: $20 Discount: 50% off
1 day 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
Have a coupon?
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

Talk to us!

  • Mail us about anything - anything! - and we will always reply :-)
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
Expand All 15 Lectures Collapse All 15 Lectures 01:56:40
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
3,256 Reviews
25,950 Students
65 Courses
A 4-person team;ex-Google; Stanford, IIM Ahmedabad, IIT

Loonycorn is us, Janani Ravi, Vitthal Srinivasan, Swetha Kolalapudi and Navdeep Singh. Between the four of us, we have studied at Stanford, IIM Ahmedabad, the IITs and have spent years (decades, actually) 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

Swetha: Early Flipkart employee, IIM Ahmedabad and IIT Madras alum

Navdeep: longtime Flipkart employee too, and IIT Guwahati alum

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 :-)