mirror of
https://github.com/USCiLab/cereal.git
synced 2025-10-18 01:45:52 +02:00
const_cast for save(), seeking for binary_oarchive
Using const cast to get rid of having two versions of save (changed vector and array so far) Initial implementation of seeking to allow saving and restoring position within a binary archive
This commit is contained in:
@@ -43,16 +43,6 @@ namespace cereal
|
||||
ar & (*it);
|
||||
}
|
||||
|
||||
//! Serialization for non-arithmetic (and bool) vector types to binary (non-const version)
|
||||
template <class T, class A>
|
||||
typename std::enable_if<!std::is_arithmetic<T>::value || std::is_same<T, bool>::value, void>::type
|
||||
save( BinaryOutputArchive & ar, std::vector<T, A> & vector )
|
||||
{
|
||||
ar & vector.size(); // number of elements
|
||||
for( auto it = vector.begin(), end = vector.end(); it != end; ++it )
|
||||
ar & (*it);
|
||||
}
|
||||
|
||||
//! Serialization for non-arithmetic (and bool) vector types from binary
|
||||
template <class T, class A>
|
||||
typename std::enable_if<!std::is_arithmetic<T>::value || std::is_same<T, bool>::value, void>::type
|
||||
|
||||
Reference in New Issue
Block a user