title: boost mutable_queue not compiling
body: <p>I have managed to work through (what appears to be) most of the initial problems, but due to the fact that some of my answers came from other people's (unanswered) questions, I am not sure if I am heading in the right direction. I am working with boost's <a href="http://www.boost.org/doc/libs/1_38_0/boost/pending/mutable_queue.hpp" rel="nofollow">mutable queue</a> and am having some issues when compiling.</p>
  
  <p>My code, as it stands, is:</p>
  
  <pre><code>typedef struct _MyComparator 
  {
      bool operator() (const PriorityStruct* arg1, const PriorityStruct* arg2) const
      {
          return arg1-&gt;key &lt; arg2-&gt;key; 
      }
  } MyComparator;
  
  class PriorityQueue
  {
      typedef PriorityStruct* entry;
      typedef boost::typed_identity_property_map&lt;entry&gt; prop_map; 
      typedef boost::mutable_queue&lt;entry, std::vector&lt;entry&gt;, MyComparator, prop_map&gt; priority_queue_notAmb;
      priority_queue_notAmb* pq;
      boost::mutex mut;
  public:
      PriorityQueue(void);
  }
  
  PriorityQueue::PriorityQueue()
  {
      pq = new priority_queue_notAmb(sizeof(entry)*2, MyComparator(), prop_map());
      PriorityStruct* ps = new PriorityStruct;
      pq-&gt;push(ps);
  }
  </code></pre>
  
  <p>When I remove the final line, pq->push(ps), the code will compile and run when creating a new PriorityQueue type. As it is, I get errors that keep it from compiling.</p>
  
  <p>And my errors are:</p>
  
  <pre><code>1&gt;------ Build started: Project: PriorityQueue, Configuration: Debug x64 ------
  1&gt;  PriorityQueue.cpp
  1&gt;C:\boost\boost\pending\mutable_queue.hpp(94): error C2679: binary '[' : no operator found which takes a right-hand operand of type 'PriorityQueue::entry ' (or there is no acceptable conversion)
  1&gt;          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\vector(1119): could be 'const unsigned __int64 &amp;std::vector&lt;_Ty&gt;::operator [](unsigned __int64) const'
  1&gt;          with
  1&gt;          [
  1&gt;              _Ty=size_t
  1&gt;          ]
  1&gt;          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\vector(1135): or       'unsigned __int64 &amp;std::vector&lt;_Ty&gt;::operator [](unsigned __int64)'
  1&gt;          with
  1&gt;          [
  1&gt;              _Ty=size_t
  1&gt;          ]
  1&gt;          while trying to match the argument list '(std::vector&lt;_Ty&gt;, PriorityQueue::entry )'
  1&gt;          with
  1&gt;          [
  1&gt;              _Ty=size_t
  1&gt;          ]
  1&gt;          C:\boost\boost\pending\mutable_queue.hpp(91) : while compiling class template member function 'void boost::mutable_queue&lt;IndexedType,RandomAccessContainer,Comp,ID&gt;::push(const IndexedType &amp;)'
  1&gt;          with
  1&gt;          [
  1&gt;              IndexedType=PriorityQueue::entry,
  1&gt;              RandomAccessContainer=std::vector&lt;PriorityQueue::entry&gt;,
  1&gt;              Comp=MyComparator,
  1&gt;              ID=PriorityQueue::prop_map
  1&gt;          ]
  1&gt;          PriorityQueue.cpp(7) : see reference to function template instantiation 'void boost::mutable_queue&lt;IndexedType,RandomAccessContainer,Comp,ID&gt;::push(const IndexedType &amp;)' being compiled
  1&gt;          with
  1&gt;          [
  1&gt;              IndexedType=PriorityQueue::entry,
  1&gt;              RandomAccessContainer=std::vector&lt;PriorityQueue::entry&gt;,
  1&gt;              Comp=MyComparator,
  1&gt;              ID=PriorityQueue::prop_map
  1&gt;          ]
  1&gt;          PriorityQueue.cpp(5) : see reference to class template instantiation 'boost::mutable_queue&lt;IndexedType,RandomAccessContainer,Comp,ID&gt;' being compiled
  1&gt;          with
  1&gt;          [
  1&gt;              IndexedType=PriorityQueue::entry,
  1&gt;              RandomAccessContainer=std::vector&lt;PriorityQueue::entry&gt;,
  1&gt;              Comp=MyComparator,
  1&gt;              ID=PriorityQueue::prop_map
  1&gt;          ]
  ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
  </code></pre>
  
  <p>Any help would be greatly appreciated, as I have been unable to find much information on this in regards to how it is used.</p>
  
  <p>Edit: As an additional test, I added </p>
  
  <pre><code>cout &lt;&lt; (pq-&gt;empty() ? "YES" : "NO") &lt;&lt; endl;
  </code></pre>
  
  <p>to see if anything strange happened. It prints "YES" every time. I replaced pq->push with this, but will keep this as an updated note unless I receive a comment or two asking me to do otherwise for readability.</p>