Ignore:
Timestamp:
Feb 7, 2008, 7:47:34 PM (14 years ago)
Author:
Peter
Message:

Simplifying distance structure

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/utility/SmartPtr.h

    r1048 r1050  
    3939    /**
    4040       \brief Constructor
     41
     42       \param p underlying pointer
     43       \param owner if true SmartPtr will be owner of pointer and if
     44       there is no more owner delete it in destructor.
     45
     46       Never use this constructor to create two SmartPtr to the same
     47       pointer such as
     48       \code
     49       MyClass* my_pointer = new MyClass;
     50       SmartPtr<MyClass> sp(my_pointer);
     51       SmartPtr<MyClass> sp2(my_pointer); // this is evil
     52       \endcode
     53       since this will cause multiple deletion. Instead use copy constructor
     54       \code
     55       MyClass* my_pointer = new MyClass;
     56       SmartPtr<MyClass> sp(my_pointer);
     57       SmartPtr<MyClass> sp2(sp);
     58       \endcode
     59       so the internal reference counter is updated.
    4160    */
    4261    explicit SmartPtr(T* p=NULL, bool owner=true)
Note: See TracChangeset for help on using the changeset viewer.