title: Why not just use a static variable as reference count for smart pointer
body: <p>When I check out the "enhanced" version smart pointer - enhancement is to have reference counting added - I see they use some "complex" techniques for the ref count, e.g. a totally seperate class or a pointer pointing to an integer.</p>
  
  <p>Here is one example:</p>
  
  <pre><code>template&lt;class T&gt;
  class SmartPointer{
    T* mp_T;
    unsigned int * mp_Count;
    public:
      ... all the APIs ...
  };
  </code></pre>
  
  <p>I am wondering, what is the gain? Since the goal is to have all the instances sharing the value, why not just declaring it as an static member variable:</p>
  
  <pre><code>template&lt;class T&gt;
  class SmartPointer{
    T* mp_T;
    static unsigned int m_Count;
    public:
      ... all the APIs ...
  };
  </code></pre>
  
  <p>I must miss something, but after some searching, I cannot find any answer. Please shed some light.</p>