How to release pointer from boost::shared_ptr?

后端 未结 14 1614
刺人心
刺人心 2020-11-30 06:42

Can boost::shared_ptr release the stored pointer without deleting it?

I can see no release function exists in the documentation, also in the FAQ is explained why it

14条回答
  •  旧巷少年郎
    2020-11-30 06:52

    You need to use a deleter that you can request not to delete the underlying pointer.

    See this answer (which has been marked as a duplicate of this question) for more information.

提交回复
热议问题