title: Trouble with boost::lockfree::queue in shared memory (boost 1.53, gcc 4.7.2 / clang 3.0-6ubuntu3)
body: <p>I have a problem with placing <code>boost::lockfree::queue&lt;&lt;T, fixed_sized&lt;false&gt;, ..&gt;</code>
  in shared memory. I need it because I have to be able to insert more than 65535 messages into the queue, and fixed_sized queue is limited with 65535.<br>
  The following code works properly (but <code>capacity&lt;...&gt;</code> option implies <code>fixed_sized&lt;true&gt;</code>):</p>
  
  <pre><code>typedef boost::interprocess::allocator&lt;
      MessageT, 
      boost::interprocess::managed_shared_memory::segment_manager&gt;
          ShmemAllocator;
  typedef boost::lockfree::queue&lt;
      MessageT,
      boost::lockfree::capacity&lt;65535&gt;,
      boost::lockfree::allocator&lt;ShmemAllocator&gt; &gt;
          Queue;
  m_segment = new boost::interprocess::managed_shared_memory(
      boost::interprocess::create_only, segmentName, size);
  Queue* m_queue = m_segment-&gt;construct&lt;Queue&gt;(
      queueName)(
      m_segment-&gt;get_segment_manager());
  ...
  m_queue-&gt;bounded_push(message);
  </code></pre>
  
  <p>The following code works properly too (but it doesn't use shared memory):</p>
  
  <pre><code>boost::lockfree::queue&lt;MessageT&gt; q;
  ....
  q.bounded_push(message);
  </code></pre>
  
  <p>But when I try to combine it:</p>
  
  <pre><code>typedef boost::interprocess::allocator&lt;
      MessageT, 
      boost::interprocess::managed_shared_memory::segment_manager&gt;
          ShmemAllocator;
  typedef boost::lockfree::queue&lt;
      MessageT,
      boost::lockfree::allocator&lt;ShmemAllocator&gt; &gt;
          Queue;
  m_segment = new boost::interprocess::managed_shared_memory(
      boost::interprocess::create_only, segmentName, size);
  Queue* m_queue = m_segment-&gt;construct&lt;Queue&gt;(
      queueName)(
      m_segment-&gt;get_segment_manager());
  ...
  m_queue-&gt;bounded_push(message);
  </code></pre>
  
  <p>it fails to compile with the following log:  </p>
  
  <pre><code>In file included from src/model/Queue.h:16:
  
  In file included from /home/uppi/lib/include/boost/lockfree/queue.hpp:24:
  
  /home/uppi/lib/include/boost/lockfree/detail/freelist.hpp:171:28: error: no viable conversion from 'pointer' (aka 'offset_ptr&lt;boost::lockfree::queue&lt;PacketMessage,
        boost::lockfree::allocator&lt;boost::interprocess::allocator&lt;PacketMessage, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family,
        boost::interprocess::offset_ptr&lt;void, long, unsigned long, 0&gt;, 0&gt;, iset_index&gt; &gt; &gt;, boost::parameter::void_, boost::parameter::void_&gt;::node, long, unsigned long, 0UL&gt;') to
        'boost::lockfree::queue&lt;PacketMessage, boost::lockfree::allocator&lt;boost::interprocess::allocator&lt;PacketMessage, boost::interprocess::segment_manager&lt;char,
        boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void, long, unsigned long, 0&gt;, 0&gt;, iset_index&gt; &gt; &gt;, boost::parameter::void_,
        boost::parameter::void_&gt;::node *'
                      return Alloc::allocate(1);
                             ~~~~~~~~~~~~~~~~~
  
  /home/uppi/lib/include/boost/lockfree/detail/freelist.hpp:157:20: note: in instantiation of function template specialization 'boost::lockfree::detail::freelist_stack&lt;boost::lockfree::queue&lt;PacketMessage,
        boost::lockfree::allocator&lt;boost::interprocess::allocator&lt;PacketMessage, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family,
        boost::interprocess::offset_ptr&lt;void, long, unsigned long, 0&gt;, 0&gt;, iset_index&gt; &gt; &gt;, boost::parameter::void_, boost::parameter::void_&gt;::node,
        boost::interprocess::allocator&lt;boost::lockfree::queue&lt;PacketMessage, boost::lockfree::allocator&lt;boost::interprocess::allocator&lt;PacketMessage, boost::interprocess::segment_manager&lt;char,
        boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void, long, unsigned long, 0&gt;, 0&gt;, iset_index&gt; &gt; &gt;, boost::parameter::void_,
        boost::parameter::void_&gt;::node, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void, long, unsigned
        long, 0&gt;, 0&gt;, iset_index&gt; &gt; &gt;::allocate_impl&lt;true&gt;' requested here
              return allocate_impl&lt;Bounded&gt;();
  
  
  /home/uppi/lib/include/boost/lockfree/detail/freelist.hpp:89:20: note: in instantiation of function template specialization 'boost::lockfree::detail::freelist_stack&lt;boost::lockfree::queue&lt;PacketMessage,
        boost::lockfree::allocator&lt;boost::interprocess::allocator&lt;PacketMessage, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family,
        boost::interprocess::offset_ptr&lt;void, long, unsigned long, 0&gt;, 0&gt;, iset_index&gt; &gt; &gt;, boost::parameter::void_, boost::parameter::void_&gt;::node,
        boost::interprocess::allocator&lt;boost::lockfree::queue&lt;PacketMessage, boost::lockfree::allocator&lt;boost::interprocess::allocator&lt;PacketMessage, boost::interprocess::segment_manager&lt;char,
        boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void, long, unsigned long, 0&gt;, 0&gt;, iset_index&gt; &gt; &gt;, boost::parameter::void_,
        boost::parameter::void_&gt;::node, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void, long, unsigned
        long, 0&gt;, 0&gt;, iset_index&gt; &gt; &gt;::allocate&lt;true, true&gt;' requested here
          T * node = allocate&lt;ThreadSafe, Bounded&gt;();
  
  
  /home/uppi/lib/include/boost/lockfree/queue.hpp:281:34: note: in instantiation of function template specialization 'boost::lockfree::detail::freelist_stack&lt;boost::lockfree::queue&lt;PacketMessage,
        boost::lockfree::allocator&lt;boost::interprocess::allocator&lt;PacketMessage, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family,
        boost::interprocess::offset_ptr&lt;void, long, unsigned long, 0&gt;, 0&gt;, iset_index&gt; &gt; &gt;, boost::parameter::void_, boost::parameter::void_&gt;::node,
        boost::interprocess::allocator&lt;boost::lockfree::queue&lt;PacketMessage, boost::lockfree::allocator&lt;boost::interprocess::allocator&lt;PacketMessage, boost::interprocess::segment_manager&lt;char,
        boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void, long, unsigned long, 0&gt;, 0&gt;, iset_index&gt; &gt; &gt;, boost::parameter::void_,
        boost::parameter::void_&gt;::node, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void, long, unsigned
        long, 0&gt;, 0&gt;, iset_index&gt; &gt; &gt;::construct&lt;true, true, PacketMessage, boost::lockfree::queue&lt;PacketMessage, boost::lockfree::allocator&lt;boost::interprocess::allocator&lt;PacketMessage,
        boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void, long, unsigned long, 0&gt;, 0&gt;, iset_index&gt; &gt; &gt;,
        boost::parameter::void_, boost::parameter::void_&gt;::node *&gt;' requested here
          node * n = pool.template construct&lt;true, Bounded&gt;(t, pool.null_handle());
  
  
  /home/uppi/lib/include/boost/lockfree/queue.hpp:270:16: note: in instantiation of function template specialization 'boost::lockfree::queue&lt;PacketMessage,
        boost::lockfree::allocator&lt;boost::interprocess::allocator&lt;PacketMessage, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family,
        boost::interprocess::offset_ptr&lt;void, long, unsigned long, 0&gt;, 0&gt;, iset_index&gt; &gt; &gt;, boost::parameter::void_, boost::parameter::void_&gt;::do_push&lt;true&gt;' requested here
          return do_push&lt;true&gt;(t);
  
  
  src/model/Queue.inl:4:18: note: in instantiation of member function 'boost::lockfree::queue&lt;PacketMessage, boost::lockfree::allocator&lt;boost::interprocess::allocator&lt;PacketMessage,
        boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void, long, unsigned long, 0&gt;, 0&gt;, iset_index&gt; &gt; &gt;,
        boost::parameter::void_, boost::parameter::void_&gt;::bounded_push' requested here
          return m_queue-&gt;bounded_push(message);                         
  
  /home/uppi/lib/include/boost/interprocess/offset_ptr.hpp:450:4: note: candidate function
     operator unspecified_bool_type() const
  </code></pre>
  
  <p>Please tell me what I'm missing</p>