title: Returning a reference from a function in c++
body: <p>I would like to ask about returning a pointer from function.</p>
  
  <p>Assuming that we have got</p>
  
  <pre><code>T *p;
  </code></pre>
  
  <p>This function should return a refrence to a <code>T</code> object. But it returns <code>*p</code> so it returns an value that it is pointing to. So is there no difference if we will write <code>T&amp; operator...</code> or <code>T operator...</code>?</p>
  
  <pre><code>   T&amp; operator*() const{
          if(p)
              return *p;
          throw std::runtime_error("unbound");
      };
  </code></pre>
  
  <p>What is a difference between returning a reference and a value normally?</p>