metaforce/Runtime/Streams/ContainerWriters.hpp

22 lines
504 B
C++
Raw Normal View History

#pragma once
#include "Runtime/Streams/COutputStream.hpp"
#include "Runtime/rstl.hpp"
#include <vector>
namespace metaforce {
template <class T, size_t N>
void write_reserved_vector(const rstl::reserved_vector<T, N>& v, COutputStream& out) {
2022-03-07 23:53:42 +00:00
out.Put<u32>(v.size());
for (const auto& t : v) {
out.Put(t);
}
}
template <class T>
void write_vector(const std::vector<T>& v, COutputStream& out) {
2022-03-07 23:53:42 +00:00
out.Put<u32>(v.size());
for (const auto& t : v) {
out.Put(t);
}
}
} // namespace metaforce