Which of the following is not a programming convention to avoid a potential pitfall associated with the use of smart pointers? If you use a smart pointer and an exception occurs in your program,...


Which of the following is not a programming convention to avoid a potential pitfall associated with the use of smart pointers?<br>If<br>you use a smart pointer and an exception occurs in your program, remember that you must use the delete operation to manually free the memory<br>associated with the smart pointer.<br>Don't use get() to initialize or reset another smart pointer.<br>If you use a pointer returned by get(), remember that the pointer will become invalid when the last corresponding smart pointer goes away.<br>Don't delete the pointer returned from get).<br>If you use a smart pointer to manage a resource other than memory allocated by new, remember to associate a deleter function when declaring the<br>smart pointer.<br>Don't use the same built-in pointer value to initialize (or reset) more than one smart pointer.<br>O O<br>

Extracted text: Which of the following is not a programming convention to avoid a potential pitfall associated with the use of smart pointers? If you use a smart pointer and an exception occurs in your program, remember that you must use the delete operation to manually free the memory associated with the smart pointer. Don't use get() to initialize or reset another smart pointer. If you use a pointer returned by get(), remember that the pointer will become invalid when the last corresponding smart pointer goes away. Don't delete the pointer returned from get). If you use a smart pointer to manage a resource other than memory allocated by new, remember to associate a deleter function when declaring the smart pointer. Don't use the same built-in pointer value to initialize (or reset) more than one smart pointer. O O

Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here