title: try-catch with exceptions defined in template class
body: <p>I'm trying to implement a priority queue using a linked list, but I'm having issues with try/catch. Here are the relevant parts of the priority queue header file:</p>
  
  <pre><code>#ifndef PRIORITYQUEUELINKED_H
  #define PRIORITYQUEUELINKED_H
  
      #include "RuntimeException.h"
      #include &lt;list&gt;
  
      using namespace std;
  
      template &lt;typename E, typename C&gt;        // uses data type and some total order relation
      class PriorityQueueLinked {
  
      // code for PriorityQueueLinked
  
              class EmptyPriorityQueueException : public RuntimeException {
                  public:
                      EmptyPriorityQueueException() : 
                                      RuntimeException("Empty priority queue") {}
              };
  
      // more code
  
      #endif
  </code></pre>
  
  <p>Here is the RuntimeException header file:</p>
  
  <pre><code>#ifndef RUNTIMEEXCEPTION_H_
  #define RUNTIMEEXCEPTION_H_
  
  #include &lt;string&gt;
  
  class RuntimeException {// generic run-time exception
  private:
      std::string errorMsg;
  public:
     RuntimeException(const std::string&amp; err) { errorMsg = err; }
     std::string getMessage() const { return errorMsg; }
  };
  
  inline std::ostream&amp; operator&lt;&lt;(std::ostream&amp; out, const RuntimeException&amp; e)
  {
     out &lt;&lt; e.getMessage();
     return out;
  }
  
  #endif
  </code></pre>
  
  <p>Here is my main:</p>
  
  <pre><code>#include "PriorityQueueLinked.h"
  #include "Comparator.h"
  #include &lt;iostream&gt;
  
  using namespace std;
  
  int main() {
      try {
          PriorityQueueLinked&lt;int,isLess&gt; prique; // empty priority queue
          prique.removeMin();                    // throw EmptyPriorityQueueException
      }
      catch(...) {
          cout &lt;&lt; "error" &lt;&lt; endl &lt;&lt; endl;
      }
      getchar();
      return 0;
  }
  </code></pre>
  
  <p>My problem lies in not being able to configure a replacement for the "..." for catch. I've tried several things, one of them: "catch(PriorityQueueLinked &lt; int,isLess > ::EmptyPriorityQueueException E)", but in this case it says that EmptyPriorityQueueException is not a member of PriorityQueueLinked. Any advice would be greatly appreciated.
  Thanks</p>