From 45124db96009cb83b23b835c4c2f3979852094bf Mon Sep 17 00:00:00 2001 From: Jidong Xiao Date: Fri, 18 Apr 2025 03:10:02 -0400 Subject: [PATCH] adding the print age line --- lectures/27_garbage_collection/shared_ptr1.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lectures/27_garbage_collection/shared_ptr1.cpp b/lectures/27_garbage_collection/shared_ptr1.cpp index 814f14e..4e99fe5 100644 --- a/lectures/27_garbage_collection/shared_ptr1.cpp +++ b/lectures/27_garbage_collection/shared_ptr1.cpp @@ -20,4 +20,9 @@ int main(){ // the shared_ptr itself is now empty (i.e., it holds nullptr). age.reset(); std::cout << "the use count is : " << age.use_count() << std::endl; + + // question: what happens if we print age here: + // std::cout << "age is " << *age << std::endl; + + return 0; }