title: Shared memory Vectors in boost with
body: <p>I have the following code. Trying to have a shared memory vector with structure having string and arrays. But when i compile the code I am getting error:</p>
  
  <pre><code> usr/local/include/boost/container/vector.hpp:1819:4: error: no matching function for call to ‘InData::InData(InData* const&amp;)’
  </code></pre>
  
  <p>Any suggestion how to fix this. I am new to Boost.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;cstdlib&gt;
  #include &lt;boost/interprocess/ipc/message_queue.hpp&gt;
  #include &lt;boost/scoped_ptr.hpp&gt;
  #include &lt;boost/interprocess/shared_memory_object.hpp&gt;
  #include &lt;boost/interprocess/managed_shared_memory.hpp&gt;
  #include &lt;boost/interprocess/mapped_region.hpp&gt;
  #include &lt;boost/interprocess/allocators/allocator.hpp&gt;
  #include &lt;boost/interprocess/containers/string.hpp&gt;
  #include &lt;boost/interprocess/containers/vector.hpp&gt;
  
  using namespace boost::interprocess;
  
  typedef boost::interprocess::basic_string&lt;char&gt; shared_string;
  
      struct InData
      {
          int X,Y,H,W;
          shared_string Label;
      };
  
      int main()
      {
  
          shared_memory_object::remove("MySharedMemory");
          managed_shared_memory managed_shm(create_only, "MySharedMemory", 10000);
  
          InData tData;// = managed_shm.construct&lt;InData&gt;("InDataStructure")();
  
          tData.Label = "Hello World";
          tData.H = 1;
          tData.W = 1;
          tData.Y = 1;
          tData.X = 1;
  
          typedef allocator&lt;InData,managed_shared_memory::segment_manager&gt; tStructData;
          typedef vector&lt;InData,tStructData&gt;  MyVector;
  
          //Initialize shared memory STL-compatible allocator
           tStructData alloc_inst (managed_shm.get_segment_manager());
  
           //Construct a vector named "MyVector" in shared memory with argument alloc_inst
            MyVector *myvector = managed_shm.construct&lt;MyVector&gt;("MyVector")(alloc_inst);
  
            //InData data;
            myvector-&gt;push_back(&amp;tData);
  
          return 0;
      }
  </code></pre>
  
  <p>If just do <code>myvector-&gt;push_back(tData)</code> </p>
  
  <pre><code>/usr/local/include/boost/container/detail/advanced_insert_int.hpp:166:10: error: no match for ‘operator=’ (operand types are ‘InData’ and ‘const value_type {aka const InData}’)
  </code></pre>