store and restore individual elements of vectors if the data is not densely packed in the vector

This commit is contained in:
Max Lyon
2021-03-02 02:11:18 +01:00
parent c1f3a4d3d1
commit 657128e6d4
2 changed files with 41 additions and 16 deletions

View File

@@ -161,8 +161,8 @@ public:
virtual size_t restore( std::istream& _istr, bool _swap ) override
{
if ( IO::is_streamable<vector_type>() && element_size() != IO::UnknownSize )
return IO::restore(_istr, data_, _swap, false); //does not need to restore its length
if ( IO::is_streamable<vector_type>() && element_size() != IO::UnknownSize)
return IO::restore(_istr, data_, _swap, false); //does not need to restore its length
size_t bytes = 0;
for (size_t i=0; i<n_elements(); ++i)