C++ allocators, specifically passing constructor arguments to objects allocated with boost::interprocess::cached_adaptive_pool
问题 This is an embarrassing question, but even the well-written documentation provided with boost.interprocess hasn't been enough for me to figure out how to do this. What I have is a cached_adaptive_pool allocator instance, and I want to use it to construct an object, passing along constructor parameters: struct Test { Test(float argument, bool flag); Test(); }; // Normal construction Test obj(10, true); // Normal dynamic allocation Test* obj2 = new Test(20, false); typedef managed_unique_ptr<