Difference between revisions of "Advanced C++ Programming Tutorial 6"

From Chilipedia
Jump to: navigation, search
(Part 1)
(Part 1)
Line 8: Line 8:
 
* How to pass/receive resources when <code>shared_ptr</code> is involved
 
* How to pass/receive resources when <code>shared_ptr</code> is involved
 
* Comparing <code>shared_ptr</code>s
 
* Comparing <code>shared_ptr</code>s
* Conversion from <code>unique_ptr</code>
+
* Conversion from <code>unique_ptr</code> to <code>shared_ptr</code>
 
* Custom deleter for <code>shared_ptr</code>
 
* Custom deleter for <code>shared_ptr</code>
  

Revision as of 23:53, 2 November 2019

Share your resources in grand style with shared_ptr.

Topics

Part 1

  • Review of unique_ptr
  • shared_ptr usage scenarios
  • use_count
  • How to pass/receive resources when shared_ptr is involved
  • Comparing shared_ptrs
  • Conversion from unique_ptr to shared_ptr
  • Custom deleter for shared_ptr

Part 2

Stay Tuned!

Video Timestamp Index

Homework

Part 1

Identify targets in the Memefighter codebase from Intermediate c++ for resource sharing, implement the sharing with std::shared_ptr, and consider/discuss potential downsides to the resource sharing for each instance of resource sharing.

See also