问题确实符合标题:我很想知道这种差异的技术原因是什么,还有理由?
std::shared_ptr<void> sharedToVoid; // legal; std::unique_ptr<void> uniqueToVoid; // ill-formed;
c++ smart-pointers shared-ptr unique-ptr
c++ ×1
shared-ptr ×1
smart-pointers ×1
unique-ptr ×1