auto_ptr for arrays

后端 未结 4 1201
[愿得一人]
[愿得一人] 2020-12-09 15:03

In short, I am wondering if there is an auto_ptr like type for arrays. I know I could roll my own, I\'m just making sure that there isn\'t already something out there.

4条回答
  •  感动是毒
    2020-12-09 15:33

    There is nothing for this in the current std library. However, the future standard C++0x has an unique_ptr, which comes in replacement of auto_ptr, and which works with arrays.

    A first implementation can be found here: unique_ptr

提交回复
热议问题