@retated : CPlusPlus STL

C++ autopointers

template <class T> class auto_ptr
{
  T* ptr;
public:
  explicit auto_ptr(T* p = 0) : ptr(p) {}
  ~auto_ptr()                 {delete ptr;}
  T& operator*()              {return *ptr;}
  T* operator->()             {return ptr;}
  // ...
};
#include <memory>
std::auto_ptr<int> v;

http://ootips.org/yonat/4dev/smart-pointers.html

Also in STL : std:auto_ptr

http://www.cerfacs.fr/Info/doc/Compilateurs/sunone7/mr/man3c++/auto_ptr.3.html

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclang98/html/MEMORY_AUTO_PTR.asp

pointers.txt · Last modified: 2022/04/16 12:23 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki