29template <
class K,
class V>
30QDataStream& operator << (QDataStream &out,
const std::map<K, V>& container) {
31 uint32_t size = container.size();
33 for (
const std::pair<const K, V>& pair : container) {
40template <
class K,
class V>
41QDataStream& operator >> (QDataStream &in, std::map<K, V>& container) {
44 for (uint32_t i = 0; i < size; ++i) {
47 container.insert(pair);
53template <
class K,
class V>
54QDataStream& operator << (QDataStream &out,
const std::multimap<K, V>& container) {
55 uint32_t size = container.size();
57 for (
const std::pair<const K, V>& pair : container) {
64template <
class K,
class V>
65QDataStream& operator >> (QDataStream &in, std::multimap<K, V>& container) {
68 for (uint32_t i = 0; i < size; ++i) {
71 container.insert(pair);
77#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
78template <
class K,
class V>
79QDataStream& operator << (QDataStream &out,
const std::pair<K, V>& pair) {
86template <
class K,
class V>
87QDataStream& operator >> (QDataStream &in, std::pair<K, V>& container) {
88 in >> container.first;
89 in >> container.second;
96QDataStream& operator << (QDataStream &out,
const std::set<K>& container) {
97 uint32_t size = container.size();
99 for (
const K& value : container) {
107QDataStream& operator >> (QDataStream &in, std::set<K>& container) {
110 for (uint32_t i = 0; i < size; ++i) {
113 container.insert(value);
120QDataStream& operator << (QDataStream &out,
const std::multiset<K>& container) {
121 uint32_t size = container.size();
123 for (
const K& value : container) {
131QDataStream& operator >> (QDataStream &in, std::multiset<K>& container) {
134 for (uint32_t i = 0; i < size; ++i) {
137 container.insert(value);
144QDataStream& operator << (QDataStream &out,
const std::vector<K>& container) {
145 uint32_t size = container.size();
147 for (
const K& value : container) {
155QDataStream& operator >> (QDataStream &in, std::vector<K>& container) {
158 container.resize(size);
159 for (uint32_t i = 0; i < size; ++i) {
167QDataStream& operator << (QDataStream &out,
const std::deque<K>& container) {
168 uint32_t size = container.size();
170 for (
const K& value : container) {
178QDataStream& operator >> (QDataStream &in, std::deque<K>& container) {
181 container.resize(size);
182 for (uint32_t i = 0; i < size; ++i) {
190QDataStream& operator << (QDataStream &out,
const std::list<K>& container) {
191 uint32_t size = container.size();
193 for (
const K& value : container) {
201QDataStream& operator >> (QDataStream &in, std::list<K>& container) {
204 for (uint32_t i = 0; i < size; ++i) {
205 typename std::list<K>::iterator itr = container.emplace(container.end());