[Serialization] Serialize std::valarray of primitives
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
Hi,
basically, you need to add "#include
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
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 mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Meik
-
mik