
Zitat von Alexander Striffeler
However, both variants returned an invalid signature exception even though I haven't changed anything on the serialized data.
I cant think of a good reason why this would happen with your code. invalid_signature is only thrown if the archive signature isnt found at the beginning of the archive. so you should receive this exception before deserializing any objects. could be because the archive was created with the no_header flag, or missing ios::binary, or using a binary archive that was created on a different architecture (sent data through network?), ..., but none of that is in your code example. if you're not using old archives created by other code: no idea. however, since you seem to also serialize individual objects, you might be interested in this archive: http://pastebin.com/PTdRE8tR it serializes objects directly to a std::vector<char> or any other char container, circumventing streams. The Serialization library is only invoked on demand, if your objects are track_never and object_serializable no Serialization archive is constructed. constructing a binary_oarchive for each object can be quite expensive (codecvt construction, pimpl construction, archive internals for pointer tracking, ...)