Replacing auto_ptr in VC++ 8

后端 未结 7 1480
Happy的楠姐
Happy的楠姐 2021-02-14 17:31

std::auto_ptr is broken in VC++ 8 (which is what we use at work). My main gripe with it is that it allows auto_ptr x = new T();, which of cour

7条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-14 17:56

    Why do you think std::auto_ptr<> is broken.

    I would have though that somthing as bad as that would have been reported to the standards comitte!

    Do you mean that you need to:

    std::auto_ptr   x(new T);  // Use the explicit constructor.
    

提交回复
热议问题