Skip to content

Commit

Permalink
update std::array
Browse files Browse the repository at this point in the history
  • Loading branch information
PeizeLin committed Jan 5, 2025
1 parent e58d69d commit 280687c
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions include/cereal/types/array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,29 +42,19 @@ namespace cereal
&& std::is_arithmetic<T>::value, void>::type
CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::array<T, N> const & array )
{
ar( binary_data( array.data(), sizeof(array) ) );
ar( binary_data( array.data(), N*sizeof(T) ) );
}

template <class Archive, class T> inline
typename std::enable_if<traits::is_output_serializable<BinaryData<T>, Archive>::value
&& std::is_arithmetic<T>::value, void>::type
CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::array<T, 0> const & array ) {}

//! Loading for std::array primitive types
//! using binary serialization, if supported
template <class Archive, class T, size_t N> inline
typename std::enable_if<traits::is_input_serializable<BinaryData<T>, Archive>::value
&& std::is_arithmetic<T>::value, void>::type
CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::array<T, N> & array )
{
ar( binary_data( array.data(), sizeof(array) ) );
ar( binary_data( array.data(), N*sizeof(T) ) );
}

template <class Archive, class T> inline
typename std::enable_if<traits::is_input_serializable<BinaryData<T>, Archive>::value
&& std::is_arithmetic<T>::value, void>::type
CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::array<T, 0> & array ) {}

//! Saving for std::array all other types
template <class Archive, class T, size_t N> inline
typename std::enable_if<!traits::is_output_serializable<BinaryData<T>, Archive>::value
Expand Down

0 comments on commit 280687c

Please sign in to comment.