auto-ptr
convert shared_ptr to auto_ptr?
I need to obtain auto_ptr from shared_ptr in my code. I can do reverse operation - convert auto_ptr to shared_ptr as shared_ptr has such constructor:[详细]
2023-02-06 19:17 分类:问答Letting go of auto_ptr
Occasionally, for fleeting moments, I think auto_ptr is cool.But most of the time I recognize that there are much simpler techniques that make it irrelevant.For example, if I want to have an object fr[详细]
2023-02-06 14:51 分类:问答C++ -- Is there an implicit cast here from Fred* to auto_ptr<Fred>?
I saw the following code, #include <new> #include <memory> using namespace std; class Fred;// Forward declaration[详细]
2023-02-02 15:27 分类:问答Does using std::auto_ptr data members invoke UB?
As a followup to Class containing auto_ptr stored in vector, I believe the unstated conclusion there is that it is OK to use classes with an auto_ptr member as container elements, so long as both copy[详细]
2023-01-26 08:11 分类:问答Difference between pointer and smart pointer
Can you tell me what is wrong with this piece of code? I got asked this in an inte开发者_如何学JAVArview and I am not sure what\'s wrong with it[详细]
2023-01-18 19:02 分类:问答auto_ptr Traps and Pitfalls
Besides all the known benefits of using auto_ptrs, what are auto_ptr \"worst-practices\"? Creating STL contrainers of auto_ptrs.[详细]
2023-01-14 06:03 分类:问答Code Review question - should I allow this passing of an auto_ptr as parameter?
Consider the following example code which I have recently seen in our code base: void ClassA::ExportAnimation(auto_ptr<CAnimation> animation)[详细]
2023-01-10 15:21 分类:问答Why does `myvector.push_back(autoPtr.release())` provide the strong exception safety guarantee?
EDIT: I should\'ve mentioned, I was looking at the documentation for Boost\'s ptr_sequence_adapter and it claims that their adapter for template< class U > void push_back( ::std::auto_ptr<U&g[详细]
2023-01-10 11:44 分类:问答question about auto_ptr::reset
pl开发者_如何学Pythonease can anybody explain this code from C++ Reference site: #include <iostream>[详细]
2023-01-07 23:03 分类:问答C++ auto_ptr and copy construction
If I have a class template <typename T> struct C { ... private: auto_ptr<T> ptr; 开发者_如何学运维};[详细]
2023-01-04 10:35 分类:问答