title: STL Priority Queue Non-Class Type Compilation Error
body: <p>I thought I had this figured out, but I guess I was wrong. I was under the impression that the first element in '&lt;...>' is the type that is to be stored in the queue, the second is the container type (the choices being 'vector' or 'dequeue') and the third is the class that overloads the '()' operator for comparison. Based on this, I think the following code should compile, but it does not :(</p>
  
  <pre><code>std::priority_queue&lt;uint32_t*, std::vector&lt;uint32_t*&gt;, edgeComparator&gt; q();
  
  uint32_t* nodeEdge = new uint32_t[2];
  nodeEdge[0] = startN;
  nodeEdge[1] = 0;
  
  q.push(nodeEdge);
  </code></pre>
  
  <p>'edgeComparator' is defined as follows:</p>
  
  <pre><code>class edgeComparator
  {
     public:
        bool operator() (const uint32_t*&amp; lhs, const uint32_t*&amp; rhs) const
        {
           return (lhs[1]&gt;rhs[1]);
        }
  };
  </code></pre>
  
  <p>Here is the error I'm getting:</p>
  
  <pre><code>./Graph.cpp: In member function `void Graph::findShortestPath()':
  ./Graph.cpp:148: error: request for member `push' in `q', which is of non-class type `std::priority_queue&lt;uint32_t*, std::vector&lt;uint32_t*, std::allocator&lt;uint32_t*&gt; &gt;, edgeComparator&gt; ()()'
  </code></pre>
  
  <p>Worse yet, I also get this error when trying 'q.empty()'</p>
  
  <pre><code>./Graph.cpp:150: error: request for member `empty' in `q', which is of non-class type `std::priority_queue&lt;uint32_t*, std::vector&lt;uint32_t*, std::allocator&lt;uint32_t*&gt; &gt;, edgeComparator&gt; ()()'
  </code></pre>