What an great library!<br><br>I am trying to extend one of the shared memory examples but I am getting a compilation error. Basically I have added a vector of char_strings to the complex object and added a method to add a string to the vector. If anyone would take a moment to give me suggestion for how to fix this issue or a suggestion for how I should better add strings to this vector I would appreciate your input. <br> <br>The error is:<br>error C2664: 'void boost::container::vector<T,A>::push_back(const� boost::interprocess::rv<T> &)' : cannot convert parameter 1 from 'char_string *' to 'const boost::interprocess::rv<T> &'<br> with [T=char_string, A=char_allocator]<br>and[T=boost::container::basic_string<char,std::char_traits<char>,char_allocator>]<br>Reason: cannot convert from 'char_string *' to 'const boost::interprocess::rv<T>'<br> with [T=boost::container::basic_string<char,std::char_traits<char>,char_allocator>]<br>No constructor could take the source type, or constructor overload resolution was ambiguous<br><br>The code is:<br>#include <boost/interprocess/managed_shared_memory.hpp><br> #include <boost/interprocess/allocators/allocator.hpp><br>#include <boost/interprocess/containers/map.hpp><br>#include <boost/interprocess/containers/vector.hpp><br>#include <boost/interprocess/containers/string.hpp><br> <br>using namespace boost::interprocess;<br><br>//Typedefs of allocators and containers<br>typedef managed_shared_memory::segment_manager���� segment_manager_t;<br>typedef allocator<void, segment_manager_t>������������������������ void_allocator;<br> typedef allocator<int, segment_manager_t>��������������������������� int_allocator;<br>typedef vector<int, int_allocator>������������������������������������������������ int_vector;<br>typedef allocator<int_vector, segment_manager_t>�������������� int_vector_allocator;<br> typedef vector<int_vector, int_vector_allocator>����������������������� int_vector_vector;<br>typedef allocator<char, segment_manager_t>������������������������ char_allocator;<br>typedef basic_string<char, std::char_traits<char>, char_allocator>�� char_string;<br> typedef vector<char_string, char_allocator>������������������������� char_string_vector_vector;<br><br>class complex_data<br>{<br>public: //Obviously making the variables of complex_data public isn't a good idea I am just playing here for the moment<br> �� int����������������������� id_;<br>�� char_string������ char_string_;<br>�� char_string_vector_vector char_string_vector_vector_;<br>�� double price_;<br>�� //Since void_allocator is convertible to any other allocator<T>, we simplify<br> �� //the initialization taking just one allocator for all inner containers.<br>�� complex_data(int id, const char *name, double prce, const void_allocator &void_alloc)<br>����� : id_(id), char_string_(name, void_alloc), char_string_vector_vector_(void_alloc), price_(prce)<br> �� {}<br><br>�� // add a string --> Error is on the next line<br>�� void addStringItem(char_string* s){char_string_vector_vector_.push_back(s);}<br>};<br><br>int main ()<br>{<br>�� //Remove shared memory on construction and destruction<br> �� struct shm_remove<br>�� {<br>����� shm_remove() { shared_memory_object::remove("MySharedMemory"); }<br>����� ~shm_remove(){ shared_memory_object::remove("MySharedMemory"); }<br>�� } remover;<br><br> �� //Create shared memory<br>�� managed_shared_memory segment(create_only,"MySharedMemory", 65536);<br><br>�� //An allocator convertible to any allocator<T, segment_manager_t> type<br>�� void_allocator alloc_inst (segment.get_segment_manager());<br> <br>�� //Construct the shared memory map and fill it<br>�� complex_data *mymap = segment.construct<complex_data>("Complex_Data")(7, "hi", 7.0, alloc_inst);<br><br>�� //<br>�� return 0;<br>}<br>