How to pass deleter to make_shared?

前端 未结 5 1016
伪装坚强ぢ
伪装坚强ぢ 2020-12-13 13:39

Since C++11, because of several reasons, developers tend to use smart pointer classes for dynamic lifetime objects. And with those new smart pointer classes, standards, even

5条回答
  •  北荒
    北荒 (楼主)
    2020-12-13 13:47

    You can't. make_shared forwards the provided arguments to the constructor of type T. It is used for the simple case when you want the default deleter.

提交回复
热议问题