15 template <
typename Stream>
18 using char_t =
typename stream_t::char_type;
27 template <
typename... Args>
28 explicit serializer(Args&&... args) : stream(std::forward<Args>(args)...) {}
37 if constexpr (std::is_arithmetic_v<T>) {
38 stream.write(reinterpret_cast<const char_t*>(&value),
sizeof(T));
Stream stream_t
The type of stream to use.
Definition: serializer.hpp:17
void serialize(serializer< Stream > &os, const dyn_matrix_impl< T, SO, D > &matrix)
Serialize the given matrix using the given serializer.
Definition: dyn.hpp:688
stream_t stream
The stream.
Definition: serializer.hpp:20
A serializer for ETL expressions.
Definition: serializer.hpp:16
Root namespace for the ETL library.
Definition: adapter.hpp:15
typename stream_t::char_type char_t
The char type of the stream.
Definition: serializer.hpp:18
serializer(Args &&... args)
Construct the serializer by forwarding the arguments to the stream.
Definition: serializer.hpp:28
serializer & operator<<(const T &value)
Outputs the given value to the stream.
Definition: serializer.hpp:36