34template<
typename T, std::
size_t SIZE>
35IBinaryStream & operator>>(IBinaryStream &stream, std::array<T, SIZE> &data)
37 for (T &value : data) {
51template<
typename T, std::
size_t SIZE>
52OBinaryStream &
operator<<(OBinaryStream &stream,
const std::array<T, SIZE> &data)
54 for (
const T &value : data) {
72IBinaryStream & operator>>(IBinaryStream &stream, std::vector<T> &data)
75 stream.read(
reinterpret_cast<char *
>(&size),
sizeof(size));
78 for (T &value : data) {
96OBinaryStream &
operator<<(OBinaryStream &stream,
const std::vector<T> &data)
98 std::size_t size = data.size();
99 stream.write(
reinterpret_cast<const char *
>(&size),
sizeof(size));
101 for (
const T &value : data) {
115template<
typename T1,
typename T2>
116IBinaryStream & operator>>(IBinaryStream &stream, std::pair<T1, T2> &data)
122 data = std::make_pair(std::move(first), std::move(second));
134template<
typename T1,
typename T2>
135OBinaryStream &
operator<<(OBinaryStream &stream,
const std::pair<T1, T2> &data)
137 stream << data.first;
138 stream << data.second;
153template<
typename K,
typename T>
154IBinaryStream & operator>>(IBinaryStream &stream, std::unordered_map<K, T> &data)
157 stream.read(
reinterpret_cast<char *
>(&size),
sizeof(size));
161 for (std::size_t i = 0; i < size; ++i) {
166 data[key] = std::move(value);
182template<
typename K,
typename T>
183OBinaryStream &
operator<<(OBinaryStream &stream,
const std::unordered_map<K, T> &data)
185 std::size_t size = data.size();
186 stream.write(
reinterpret_cast<const char *
>(&size),
sizeof(size));
188 for (
const auto &entry : data) {
189 stream << entry.first;
190 stream << entry.second;
206template<
typename K,
typename T>
207IBinaryStream & operator>>(IBinaryStream &stream, std::map<K, T> &data)
210 stream.read(
reinterpret_cast<char *
>(&size),
sizeof(size));
213 for (std::size_t i = 0; i < size; ++i) {
218 data[key] = std::move(value);
234template<
typename K,
typename T>
235OBinaryStream &
operator<<(OBinaryStream &stream,
const std::map<K, T> &data)
237 std::size_t size = data.size();
238 stream.write(
reinterpret_cast<const char *
>(&size),
sizeof(size));
240 for (
const auto &entry : data) {
241 stream << entry.first;
242 stream << entry.second;
259IBinaryStream & operator>>(IBinaryStream &stream, std::unordered_set<T> &data)
262 stream.read(
reinterpret_cast<char *
>(&size),
sizeof(size));
266 for (std::size_t i = 0; i < size; ++i) {
269 data.insert(std::move(value));
286OBinaryStream &
operator<<(OBinaryStream &stream,
const std::unordered_set<T> &data)
288 std::size_t size = data.size();
289 stream.write(
reinterpret_cast<const char *
>(&size),
sizeof(size));
291 for (
const auto &value : data) {
306IBinaryStream & operator>>(IBinaryStream &stream, T &data)
308 stream.read(
reinterpret_cast<char *
>(&data),
sizeof(T));
321OBinaryStream &
operator<<(OBinaryStream &stream,
const T &data)
323 stream.write(
reinterpret_cast<const char *
>(&data),
sizeof(T));
Logger & operator<<(Logger &logger, LoggerManipulator< T > &&m)