AMDG On 11/21/2018 11:57 AM, Ferguson, Neil D CTR (US) via Boost-users wrote:
Sirs and madams, I hope to use boost interprocess shared memory to pass complex and dynamic data structures between processes on a host efficiently. The structures will be comprised only of simple primitives (int, float, etc.), interprocess basic_string, interprocess containers (vectors and maps), containers of containers, and (possible deal killer) boost::any. From the interprocess documentation, it _looks_ like the preceding is doable, aside from boost::any. The boost::any objects will themselves contain only primitives, basic_string, or interprocess vectors of unsigned char. So it _looks_ like the data held by the any should be okay. My question: does boost::any use pointers, references, or other constructs that preclude the class from working in shared memory?
Yes, it does. I recommend using variant instead. In Christ, Steven Watanabe