boost::interprocess::containers::vector でブースト シリアル化を使用したい
std::vector のシリアル化は、含めることで正常に機能します
#include <boost/interprocess/containers/vector.hpp>
しかし、共有ベクトルを含むクラスがあります
class MyClass {
public:
typedef boost::interprocess::allocator<double, SegmentManager> Allocator;
typedef boost::interprocess::vector<double, Allocator > VectorDouble;
VectorDouble *pVar;
template<class archive>
void serialize ( archive &ar, const unsigned int version ) {
using boost::serialization::make_nvp;
ar & make_nvp ( "data", *pVar; ); # This does not work
# what works it creating a std::vector and copy the data
}
...
MyClass(){
# creating the shared memory and the pointer ot pVarß
}
~MyClass(){
# release data
}
}
エラーが発生しています:
error: ‘class boost::container::vector<double, boost::interprocess::allocator<double, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void>, 0u>, boost::interprocess::iset_index> > >’ has no member named ‘serialize’