Packt

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

还剩 8 天! 通过 Coursera Plus 提高技能,仅需 239 美元/年(原价 399 美元)。立即节省

Packt

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

包含在 Coursera Plus

深入了解一个主题并学习基础知识。
中级 等级

推荐体验

8 小时 完成
灵活的计划
自行安排学习进度
深入了解一个主题并学习基础知识。
中级 等级

推荐体验

8 小时 完成
灵活的计划
自行安排学习进度

您将学到什么

  • 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.

要了解的详细信息

可分享的证书

添加到您的领英档案

最近已更新!

April 2026

作业

12 项作业

授课语言:英语(English)

了解顶级公司的员工如何掌握热门技能

Petrobras, TATA, Danone, Capgemini, P&G 和 L'Oreal 的徽标

该课程共有11个模块

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.

涵盖的内容

1个视频

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.

涵盖的内容

6个视频1个作业

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.

涵盖的内容

8个视频1个作业

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.

涵盖的内容

2个视频1个作业

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.

涵盖的内容

4个视频1个作业

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.

涵盖的内容

6个视频1个作业

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.

涵盖的内容

7个视频1个作业

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.

涵盖的内容

4个视频1个作业

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++.

涵盖的内容

3个视频1个作业

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.

涵盖的内容

4个视频1个作业

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.

涵盖的内容

6个视频3个作业

位教师

Packt - Course Instructors
Packt
1,695 门课程479,206 名学生

提供方

Packt

从 Software Development 浏览更多内容

人们为什么选择 Coursera 来帮助自己实现职业发展

Felipe M.

自 2018开始学习的学生
''能够按照自己的速度和节奏学习课程是一次很棒的经历。只要符合自己的时间表和心情,我就可以学习。'

Jennifer J.

自 2020开始学习的学生
''我直接将从课程中学到的概念和技能应用到一个令人兴奋的新工作项目中。'

Larry W.

自 2021开始学习的学生
''如果我的大学不提供我需要的主题课程,Coursera 便是最好的去处之一。'

Chaitanya A.

''学习不仅仅是在工作中做的更好:它远不止于此。Coursera 让我无限制地学习。'
Coursera Plus

通过 Coursera Plus 开启新生涯

无限制访问 10,000+ 世界一流的课程、实践项目和就业就绪证书课程 - 所有这些都包含在您的订阅中

通过在线学位推动您的职业生涯

获取世界一流大学的学位 - 100% 在线

加入超过 3400 家选择 Coursera for Business 的全球公司

提升员工的技能,使其在数字经济中脱颖而出

常见问题