New standard for C++, namely “C++0x”, is introducing a new smart pointer type: std::unique_ptr. GCC (and probably other C++ compilers too) supports it already. But unfortunately it’s hard to find good documentation for std::unique_ptr in the Internet. What is important about that:

  1. std::unique_ptr type is available in header <memory>
  2. Use it instead of std::auto_ptr which is deprecated now (AFAIK) – in general std::unique_ptr is replacement for std:auto_ptr.
  3. Motivation to use: simpler (less memory footprint? faster?) smart pointer when you don’t need something more sophisticated like boost::shared_ptr

About krzysztoftomaszewski

I've got M.Sc. in software engineering. I graduated in 2005 at Institute of Computer Science, Warsaw University of Technology, Faculty of Electronics and Information Technology. I'm working on computer software design and engineering continuously since 2004.
This entry was posted in C++, C++ stdlib. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s