1. Home
  2. Computer Science MCQs
  3. C++ and Object-Oriented Programming
  4. Which property belongs to std::unique_ptr?

Added 30 Nov -0001

Which property belongs to std::unique_ptr?

  1. Automatic conversion to a raw pointer
  2. Storage of objects without a deleter
  3. Exclusive ownership that cannot be copied Correct answer
  4. Shared ownership counted per object

Correct answer

C. Exclusive ownership that cannot be copied

12 views

MCQSEXAM

Explanation

std::unique_ptr models sole ownership and is move-only, so copying it is a compile-time error.

Reference

Asked in: NTS, PPSC IT, Campus Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is C? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More C++ and Object-Oriented Programming MCQs

Practise all C++ and Object-Oriented Programming MCQs

Similar MCQs