VirtualBox

Ignore:
Timestamp:
Jan 24, 2014 8:23:12 AM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
91785
Message:

spaces

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/NetworkServices/NetLib/shared_ptr.h

    r49339 r50213  
    33
    44#ifdef __cplusplus
    5 template<typename T> 
     5template<typename T>
    66class SharedPtr
    77{
    8     struct imp 
     8    struct imp
    99    {
    1010        imp(T *pTrg = NULL, int cnt = 1): ptr(pTrg),refcnt(cnt){}
     
    1515    };
    1616
    17    
     17
    1818    public:
    1919    SharedPtr(T *t = NULL):p(NULL)
     
    2121        p = new imp(t);
    2222    }
    23    
     23
    2424    ~SharedPtr()
    2525    {
     
    4040    {
    4141        if (p == rhs.p) return *this;
    42        
     42
    4343        p->refcnt--;
    44         if (p->refcnt == 0) 
     44        if (p->refcnt == 0)
    4545            delete p;
    4646
     
    5757    }
    5858
    59    
     59
    6060    T *operator->()
    6161    {
     
    6363    }
    6464
    65    
     65
    6666    const T*operator->() const
    6767    {
     
    7979};
    8080#endif
     81
    8182#endif
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette