In practice with C++, what is RAII, what are smart pointers, how are these implemented in a program and what are the benefits ...
-
May 31, 2022
- 0 Comments
Ok, so the last time I wrote C++ for a living, std::auto_ptr was all the std lib had available, and boost::shared_ptr was all ...
-
May 24, 2022
- 0 Comments
What is wrong with this program? #include <memory> #include <vector> int main() { std::vector<std::unique_ptr<int>> vec; int x(1); std::unique_ptr<int> ptr2x(&x); vec.push_back(ptr2x); //This tiny command ...
-
May 21, 2022
- 0 Comments
std::unique_ptr has support for arrays, for instance: std::unique_ptr<int> p(new int...
What is a smart pointer and when should I use one? 1 14 UPDATE This answer is rather old, and so describes what ...
-
April 10, 2022
- 0 Comments