adapt store/restore functions as well as size of, so that

for std::vector the size is stored if desired
This commit is contained in:
Alexandra Heuschling
2021-02-26 19:04:20 +01:00
parent cf45a5d3cc
commit 5c0066b490
2 changed files with 25 additions and 6 deletions

View File

@@ -89,18 +89,34 @@ template <typename T> inline
size_t size_of( const T& _v )
{ return binary< T >::size_of(_v); }
template <typename T> inline
size_t size_of( const std::vector<T> & _v, bool _store_size = true)
{ return binary< std::vector<T> >::size_of(_v, _store_size); }
template <typename T> inline
size_t size_of(void)
{ return binary< T >::size_of(); }
template <typename T> inline
size_t size_of(bool _store_size)
{ return binary< std::vector<T> >::size_of(_store_size); }
template <typename T> inline
size_t store( std::ostream& _os, const T& _v, bool _swap=false)
{ return binary< T >::store( _os, _v, _swap ); }
template <typename T> inline
size_t store( std::ostream& _os, const std::vector<T>& _v, bool _swap=false, bool _store_size = true)
{ return binary< std::vector<T> >::store( _os, _v, _swap, _store_size); }
template <typename T> inline
size_t restore( std::istream& _is, T& _v, bool _swap=false)
{ return binary< T >::restore( _is, _v, _swap ); }
template <typename T> inline
size_t restore( std::istream& _is, std::vector<T>& _v, bool _swap=false, bool _restore_size = true)
{ return binary< std::vector<T> >::restore( _is, _v, _swap, _restore_size); }
//@}