Thank you for your kind reply.
I am experimenting but it seems that even with a unique Cereal archive for all expressions in a vec_basic, I still get duplicates:
```
std::string Basic::dumps0(const vec_basic &v)
{
std::ostringstream oss;
unsigned short major = SYMENGINE_MAJOR_VERSION;
unsigned short minor = SYMENGINE_MINOR_VERSION;
size_t vec_len = v.size();
cereal::PortableBinaryOutputArchive ser(oss);
ser(major, minor, vec_len);
for (size_t i = 0; i < vec_len; i++) {
ser(v[i]);
}
return oss.str();
}
vec_basic Basic::loads_vec0(const std::string &str)
{
unsigned short major, minor;
size_t vec_len;
vec_basic v;
std::istringstream iss(str);
cereal::PortableBinaryInputArchive iarchive{iss};
iarchive(major, minor, vec_len);
if (major != SYMENGINE_MAJOR_VERSION or minor != SYMENGINE_MINOR_VERSION) {
throw SerializationError(StreamFmt()
<< "SymEngine-" << SYMENGINE_MAJOR_VERSION
<< "." << SYMENGINE_MINOR_VERSION
<< " was asked to deserialize an object "
<< "created using SymEngine-" << major << "."
<< minor << ".");
}
if (vec_len == 0) {
throw SerializationError("Cannot deserialize an empty vector.");
}
for (size_t i = 0; i < vec_len; ++i) {
RCP<const Basic> p;
iarchive(p);
v.push_back(p);
}
return v;
}
```
I specifically checked to see if we have duplicates in a single expr and that's NOT the case.
Any advice?