
Thanks a lot. The object_pool approach doesn't work; it causes also a segmentation fault. The option of explicitly allocating the object does work fine.
Make sure you use a recent compiler and Boost. I have seen pool
segfaulting on some not-so-old platforms, especially with pool_allocator
being used with nested containers. I found out that with Boost 1.34.1,
g++ 4.3.0 and MSVC 9.0 all works fine.
For example the following segfaults with g++ 4.2.2 + boost 1.32:
#include