#ifndef CEREAL_BINARY_ARCHIVE_ARRAY_HPP_ #define CEREAL_BINARY_ARCHIVE_ARRAY_HPP_ #include #include namespace cereal { //! Saving for std::array primitive types to binary template typename std::enable_if::value, void>::type save( BinaryOutputArchive & ar, std::array const & array ) { ar.save_binary( array.data(), N * sizeof(T) ); } //! Loading for std::array primitive types to binary template typename std::enable_if::value, void>::type load( BinaryInputArchive & ar, std::array & array ) { ar.load_binary( array.data(), N * sizeof(T) ); } //! Saving for const std::array all other types to binary template typename std::enable_if::value, void>::type save( BinaryOutputArchive & ar, std::array const & array ) { for( auto const & i : array ) ar & i; } //! Saving for non-const std::array all other types to binary template typename std::enable_if::value, void>::type save( BinaryOutputArchive & ar, std::array & array ) { for( auto & i : array ) ar & i; } //! Loading for std::array all other types from binary template typename std::enable_if::value, void>::type load( BinaryInputArchive & ar, std::array & array ) { for( auto & i : array ) ar & i; } } // namespace cereal #endif // CEREAL_BINARY_ARCHIVE_ARRAY_HPP_