Which statement is false:
A) A weak_ptr points to the resource managed by a shared_ptr without assuming any responsibility for it.
B) The reference count for a shared_ptr doesn't increase when a weak_ptr references it. That means that the resource of a shared_ptr can be deleted while there are still weak_ptrs pointing to it. When the last shared_ptr is destroyed, the resource is deleted and any remaining weak_ptrs are set to NULL.
C) One use for weak_ptr s is to avoid memory leaks caused by circular references.
D) None of the above.
Correct Answer:
Verified
Q1: Each time a new shared_ptr to the
Q2: A copy constructor, a destructor and an
Q3: A unique_ptr automatically calls _ to free
Q4: The _ multithreading header contains class thread
Q5: Weak_ptrs should be used in any situation
Q7: The internal pointer is deleted once the
Q8: The _ multithreading header contains classes and
Q9: When the reference count reaches zero, the
Q10: In the following function int square(int value)
{
Return
Q11: Which of the following statements is false?
A)
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents