| 180 | } |
| 181 | } |
| 182 | inline static bool Read(Stream *strm, std::basic_string<T> *out_vec) { |
| 183 | uint64_t sz; |
| 184 | if (!strm->Read<uint64_t>(&sz)) return false; |
| 185 | size_t size = static_cast<size_t>(sz); |
| 186 | out_vec->resize(size); |
| 187 | if (sz != 0) { |
| 188 | size_t nbytes = sizeof(T) * size; |
| 189 | return strm->Read(&(*out_vec)[0], nbytes) == nbytes; |
| 190 | } |
| 191 | return true; |
| 192 | } |
| 193 | }; |
| 194 | |
| 195 | /*! \brief Serializer for std::pair */ |