Playerfff
Results
1
issues of
Playerfff
template smart_ptr::smart_ptr(const smart_ptr& rhs) :m_pobject(rhs.m_pobject), m_p_use_count(rhs.m_p_use_count), m_del(rhs.m_del) { (*m_p_use_count)++; } 如果调用这个函数,例如:smart_ptr ptr2(ptr1); 只有ptr2的引用计数会加1,ptr1的引用计数没变,我觉得有问题,应该ptr1和ptr2使用一块memory作为引用计数,确保ptr2在增加引用计数时ptr1的引用计数也会变。