IT Nursery
With the new standard coming (and parts already available in some compilers), the new type std::unique_ptr is supposed to be a replacement for std::auto_ptr. Does their usage exactly overlap...
  • May 31, 2022
  • 0 Comments
IT Nursery
In practice with C++, what is RAII, what are smart pointers, how are these implemented in a program and what are the benefits of using RAII with smart pointers?...
  • May 31, 2022
  • 0 Comments
What is the difference between the following set of pointers? When do you use each pointer in production code, if at all? Examples would be appreciated! scoped_ptr shared_ptr weak_ptr...
  • May 25, 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 the rage. I never really looked...
  • 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 has a vicious error. return 0;...
  • May 21, 2022
  • 0 Comments