Quantcast
Viewing latest article 4
Browse Latest Browse All 7

GotW #103: Smart Pointers, Part 1 (Difficulty: 3/10)

JG Question

1. When should you use shared_ptr vs. unique_ptr? List as many considerations as you can.

 

Guru Questions

2. Why should you always use make_shared to allocate objects whose lifetimes will be managed by shared_ptr? Explain.

3. What’s the deal with auto_ptr?


Viewing latest article 4
Browse Latest Browse All 7

Trending Articles