Packt

Practical Guide to Mastering C++ Smart Pointers - Part 01

Ends soon: Grow your skills with Coursera Plus for $239/year (usually $399). Save now.

Packt

Practical Guide to Mastering C++ Smart Pointers - Part 01

Included with Coursera Plus

Gain insight into a topic and learn the fundamentals.
Intermediate level

Recommended experience

8 hours to complete
Flexible schedule
Learn at your own pace
Gain insight into a topic and learn the fundamentals.
Intermediate level

Recommended experience

8 hours to complete
Flexible schedule
Learn at your own pace

What you'll learn

  • Master the use of smart pointers like std::unique_ptr and std::shared_ptr in C++.

  • Implement advanced memory management techniques, including custom deleters and the PIMPL idiom.

  • Learn to efficiently use smart pointers in containers and handle reallocation scenarios.

  • Apply smart pointers in practical projects such as game development and object pools.

Details to know

Shareable certificate

Add to your LinkedIn profile

Recently updated!

April 2026

Assessments

12 assignments

Taught in English

See how employees at top companies are mastering in-demand skills

 logos of Petrobras, TATA, Danone, Capgemini, P&G and L'Oreal

There are 11 modules in this course

In this module, we will introduce the foundational concepts of smart pointers in C++. We will lay the groundwork for understanding the necessity of smart pointers and how they contribute to memory safety and resource management in C++ programming.

What's included

1 video

In this module, we will explore dynamic memory allocation techniques in C. From malloc() and calloc() to realloc(), you'll learn the basics of handling memory in C before diving deeper into C++ memory management.

What's included

6 videos1 assignment

In this module, we will discuss memory allocation in C++ using the new and new[] operators. You will learn to allocate memory, manage arrays, and handle memory allocation failures effectively, setting the stage for smart pointer usage.

What's included

8 videos1 assignment

In this module, we will introduce the concept of smart pointers in C++, explaining their significance and how they overcome common pitfalls associated with raw pointers, offering safer and more efficient memory management.

What's included

2 videos1 assignment

In this module, we will dive into std::unique_ptr, showcasing its usage in managing dynamic memory. You will learn how to safely return and pass unique_ptrs, which helps ensure proper memory management and ownership semantics.

What's included

4 videos1 assignment

In this module, we will focus on replacing raw pointers with smart pointers to eliminate common memory management errors. We will discuss strategies for preventing uninitialized pointers, dangling references, and the importance of exception safety.

What's included

6 videos1 assignment

In this module, we will introduce custom deleters within smart pointers, providing more flexibility and control over memory management. We’ll cover how to define and use custom deleters to handle various memory management scenarios effectively.

What's included

7 videos1 assignment

In this module, we will focus on std::make_unique and its role in simplifying memory management. You’ll learn how to use it to manage dynamic arrays safely and explore advanced techniques for efficient memory handling.

What's included

4 videos1 assignment

In this module, we will introduce the PIMPL (Pointer to IMPLementation) idiom, which is a valuable technique for hiding implementation details and managing memory more effectively in C++.

What's included

3 videos1 assignment

In this module, we will walk through a project that implements key concepts of smart pointers in C++. You’ll develop a game and an object pool, applying everything you’ve learned about memory management using smart pointers.

What's included

4 videos1 assignment

In this module, we will cover advanced C++ concepts, including constructor behavior, observer patterns, and operator overloading. You’ll also learn about constexpr unique_ptr for compile-time memory management.

What's included

6 videos3 assignments

Instructor

Packt - Course Instructors
Packt
1,674 Courses477,715 learners

Offered by

Packt

Explore more from Software Development

Why people choose Coursera for their career

Felipe M.

Learner since 2018
"To be able to take courses at my own pace and rhythm has been an amazing experience. I can learn whenever it fits my schedule and mood."

Jennifer J.

Learner since 2020
"I directly applied the concepts and skills I learned from my courses to an exciting new project at work."

Larry W.

Learner since 2021
"When I need courses on topics that my university doesn't offer, Coursera is one of the best places to go."

Chaitanya A.

"Learning isn't just about being better at your job: it's so much more than that. Coursera allows me to learn without limits."
Coursera Plus

Open new doors with Coursera Plus

Unlimited access to 10,000+ world-class courses, hands-on projects, and job-ready certificate programs - all included in your subscription

Advance your career with an online degree

Earn a degree from world-class universities - 100% online

Join over 3,400 global companies that choose Coursera for Business

Upskill your employees to excel in the digital economy

Frequently asked questions