|
Boost Users : |
From: Meik (yuki_meik_at_[hidden])
Date: 2019-12-21 21:09:19
Hello,
I am new to C++ and thus new to Boost. My goal is to serialize a class
containing multiple std::valarrays with primitives as content.
The code I wrote to achieve that(minimal example to reproduce):
   #include <iostream>
   #include <boost/archive/text_oarchive.hpp>
   class A {
       valarray<int> member_one;
       valarray<float> member_two;
       friend class boost::serialization::access;
       template<class Archive>
       void serialize(Archive &ar, const unsigned int version){
               ar & member_one;
               ar & member_two
       }
   }
   int main(int argc, char* argv[]) {
       boost::archive::text_oarchive oarchive(cout);
       oarchive << p;
       return 0;
   }
When compiling this, the following error is given:
error: class std::valarray<int> has no member names serialize
I'd appreciate if you could let me know how to correctly serialize said
std::valarray.
Kind regards,
Meik S.
||
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net