Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

std - shared_ptr - T

code::dive conference via YouTube

Overview

Save Big on Coursera Plus. 7,000+ courses at $160 off. Limited Time Only!
Explore a comprehensive lecture from the code::dive 2016 conference focusing on std::shared_ptr in C++. Delve into the intricacies of C++ standard library smart pointers, RAII principles, and resource ownership. Examine problem statements, usage examples, and potential pitfalls of std::shared_ptr. Investigate thread safety considerations, mandatory synchronization, and idealistic implementations. Learn about custom deleters, allocator interfaces, type erasure, and Empty Base Optimization. Gain insights into the design overview, advantages of separate pointers, and the aliasing constructor. Enhance your understanding of C++ memory management and smart pointer usage through this in-depth presentation.

Syllabus

Intro
WHY DO WE USE C++?
C++ STANDARD LIBRARY SMART POINTERS
RAII (RESOURCE ACQUISITION IS INITIALIZATION)
RESOURCE OWNERSHIP
PROBLEM STATEMENT
SIMPLE USAGE EXAMPLE
std::shared_ptr - INCORRECT APPROACH
std::shared_ptr - IDEALISTIC APPROACH
IS std::shared_ptr THREAD-SAFE?
MANDATORY SYNCHRONIZATION
IDEALISTIC IMPLEMENTATION
HERB SUTTER'S FAVORITE C++ 10-LINER
std::shared_ptr CONSTRUCTION
CUSTOM DELETER INTERFACE
CUSTOM ALLOCATOR INTERFACE
ALLOCATOR TRAITS
TYPE ERASURE
EMPTY BASE OPTIMIZATION (EBO)
DESIGN OVERVIEW
ADVANTAGES OF HAVING 2 SEPARATE POINTERS
ALIASING CONSTRUCTOR

Taught by

code::dive conference

Reviews

Start your review of std - shared_ptr - T

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.