23#ifndef VCL_BASE_SERIALIZATION_DESERIALIZE_H
24#define VCL_BASE_SERIALIZATION_DESERIALIZE_H
28#include <vclib/base/concepts/serialization.h>
29#include <vclib/base/concepts/types.h>
49void deserialize(std::istream& is, T& data, std::endian endian)
51 is.read(
reinterpret_cast<char*
>(&data),
sizeof(T));
52 if (endian != std::endian::native) {
53 data = detail::swapEndian(data);
77 std::endian endian = std::endian::little)
79 for (std::size_t i = 0; i < size; ++i) {
80 deserialize(is, data[i], endian);
84template<
typename T,
typename... Others>
85void deserialize(std::istream& is, T& data, Others&... others)
87 if constexpr (Serializable<T>) {
91 deserialize(is, data, std::endian::little);
93 if constexpr (
sizeof...(Others) > 0) {
94 deserialize(is, others...);
void deserialize(std::istream &is)
Deserializes the box from the given input stream.
Definition box.h:476