| 27 | |
| 28 | template <typename C> |
| 29 | inline void write_container(std::ostream& s, const C& c) |
| 30 | { |
| 31 | using V = typename C::value_type; |
| 32 | static_assert(std::is_standard_layout_v<V> && std::is_trivial_v<V>); |
| 33 | write_pod(s, nd::dtype_enum_v<V>); |
| 34 | write_pod(s, c.size()); |
| 35 | s.write(reinterpret_cast<const char*>(c.data()), c.size() * sizeof(V)); |
| 36 | } |
| 37 | |
| 38 | template <typename F> |
| 39 | inline auto read_vector(std::istream& s, F f) |