Question: Which function call signature should be used to pass a std:unique_ptr, std:shared_ptr and std::weak_ptr to function that will not modify or replace the raw pointer?
Which function call signature should be used to pass a std:unique_ptr, std:shared_ptr and std::weak_ptr to function that will not modify or replace the raw pointer? Select one. void call_function_with_pointers_3(const std:uunique_ptr & uniquePtr, const std:ushared_ptr\& sharedPtr. const std: weak_ptr\& weakPtr); void call_function_with_pointers_4(A* uniquePtr, const std:ishared_ptr sharedPtr, const std:wweak_ptr weakPtr); void call_function_with_pointers_2(std:unique_ptr & uniquePtr, std:shared_ptr & sharedPtr, std::weak_ptr\& weakPtr); void call_function_with_pointers_1(std:unique_ptr uniquePtr, std:ishared_ptrsharedPtr. std:weak_ ptr weakPtr): Question 5 (5 points) How do you transfer ownership of a pointer that is exclusively owned? Select one. std::unique_ptrptr2 = ptr1; std::unique_ptr ptr2 = std:move(ptr1); std::unique_ptrptr2(ptr1); std::unique_ptr ptr2= std::make_unique A>(ptr1); Question 6 (5 points) Which smart pointer should be used when you want to create a pointer with exclusive ownership of the newly created type (new A):? Select one. std::unique ptrp( new A) : std:pointer p(newA); std:iauto_ptrp(new A(0) ): std:exclusive_ptrp(new A)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
