title: Fix a return issue.Warning: control reaches end of non-void function in C++
body: <p>I know this may look as a duplicate, but the other questions does not have the answer that I am looking for.   </p>
  
  <pre><code>template &lt;class T&gt;
  T Queue&lt;T&gt;::pop_back()
  {
      try
      {
          if (empty())
              throw "The Queue is empty!";
          size--;
          back= (back- 1 + max_size) % (max_size);
          return queue[back];
      }
      catch (char* strException)
      {
          cerr &lt;&lt; "Error: " &lt;&lt; strException &lt;&lt; endl;
      }
  }
  </code></pre>
  
  <p>I have the above implementations of functions pop_back. Every time it removes the element it has to return that element. However, every time it tries to pop something from an empty Queue it says " terminate called after throwing an instance of 'char const*'
  Aborted (core dumped)"</p>
  
  <p>What are some tips and advice to fix this issue? I have a try catch block there but it is not helping much. The functions has to return something, or stop and return to main, from where it was called.</p>
  
  <p>I am looking for a design patter so I can used it other times I encounter such a problem.
  Basically what should I do when I need to return something but there is nothing I can return?</p>
  
  <p>Thank you.</p>