auto-ptr
So can unique_ptr be used safely in stl collections?
I am confused with unique_ptr and rvalue move philosophy. Let\'s say we have two collections: std::vector<std::auto_ptr<int>> autoCollection;[详细]
2023-01-01 00:17 分类:问答Qt and auto_ptr
I just discovered the concept of an auto_ptr and am liking it! As Qt often requires a QList or QVector<(some QObject or QWidget) *>, is there any concrete reason why auto_ptr should be avoided. If[详细]
2022-12-30 23:50 分类:问答C++ smart pointer for a non-object type?
I\'m trying to use smart pointers such as auto_ptr, shared_ptr. However, I don\'t know how to use it in this situation.[详细]
2022-12-30 07:05 分类:问答Normal pointer vs Auto pointer (std::auto_ptr)
Code snippet (normal pointer) int *pi = new int; int i = 90; pi = &i; int k = *pi + 10; cout<<k<<endl;[详细]
2022-12-28 02:09 分类:问答Compilation problems with vector<auto_ptr<> >
Consider the following code: #include <iostream> #include <memory> #include <vector> using namespace std;[详细]
2022-12-26 18:00 分类:问答should std::auto_ptr<>::operator = reset / deallocate its existing pointee?
I read here about std::auto_ptr<>::operator= Notice however that the left-hand side object is not automatically[详细]
2022-12-26 04:55 分类:问答Why it's can be compiled in GNU/C++, can't compiled in VC++2010 RTM?
#include <stdlib.h> #include <iostream> #include <memory> #include \"copy_of_auto_ptr.h\"[详细]
2022-12-25 15:50 分类:问答Can i pass auto_ptr by reference to functions?
is the following funct开发者_Python百科ion OK: void DoSomething(auto_ptr< … >& a)....[详细]
2022-12-23 20:57 分类:问答Is auto_ptr deprecated?
Will auto_ptr be deprecated in incoming C++ standard? Should unique_ptr be used for ownership transfer instead of shared_ptr?[详细]
2022-12-22 02:34 分类:问答How does c++ auto_ptr relate to managed pointers (Java, C#...)
I come from a managed world and c++ automatic memory management is quite unclear to me I开发者_JAVA技巧f I understand correctly, I encapsulate a pointer within a stack object and when auto_ptr become[详细]
2022-12-18 03:38 分类:问答