Nice!!! Thank you for help!!
Arman Khalatyan escribió:
Hi, Thanks for your detailed explanations.[...]
I was paying with your nice example.
Currently my structure is keeping only several floats, ints and unsigned ints.
Following the Interprocess documentation, as you wrote, I can put them directly
into shared memory:
Now I am trying to access the memory from client:
shared_memory_object shm (open_only, "shared_memory", read_only);
//Map the whole shared memory in this process
mapped_region region(shm, read_only);
//Check that memory was initialized to 1
const particlesID_set *P = static_cast<particlesID_set*>(region.get_address());
//const particlesID_set::nth_index<1>::type L1_ID_index = (*P).get<1>();// This does not compile, Why?
It is
const particlesID_set::nth_index<1>::type& L1_ID_index = ...
Note the added '&'; this is explained for instance at the final paragraph of
http://www.boost.org/libs/multi_index/doc/tutorial/basics.html#multiple_sort
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users