| 179 | |
| 180 | template <typename T, typename std::enable_if<is_contiguous_container<T>::value && !is_contiguous_container<typename T::value_type>::value, int>::type = 0> |
| 181 | bool serialize(std::string& val, const T& t) { |
| 182 | auto s = sizeof(typename T::value_type) * t.size(); |
| 183 | val.resize(s + 1); |
| 184 | val[0] = TypeEncoder::encode_type<T>(); |
| 185 | memcpy(val.data() + 1, t.data(), s); |
| 186 | return true; |
| 187 | } |
| 188 | |
| 189 | template <typename T, typename std::enable_if<is_contiguous_container<T>::value&& is_contiguous_container<typename T::value_type>::value, int>::type = 0> |
| 190 | bool serialize(std::string& val, const T& t) { |