Unfortunately, this is not possible directly. You will need to do serialization.
Since you mention MPI, you are probably interested in high performance. In this case, using serialization is probably not the best idea. Therefore, I would stay away from more complex STL structures and only work with std::vector .
source share