message: Add streaming of std::map and checksum
diff: #include <boost/container/flat_map.hpp>
  #include <eosiolib/varint.hpp>
  #include <array>
  +#include <map>
  #include <string>
  @@ -140,7 +141,7 @@ class datastream<size_t> {
  * @param d value to serialize
  */
  template<typename Stream>
  -inline datastream<Stream>& operator<<(datastream<Stream>& ds, const key256 d) {
  +inline datastream<Stream>& operator<<(datastream<Stream>& ds, const key256& d) {
  ds.write( (const char*)d.data(), d.size() );
  return ds;
  }
  @@ -164,7 +165,7 @@ inline datastream<Stream>& operator>>(datastream<Stream>& ds, key256& d) {
  * @param d value to serialize
  */
  template<typename Stream>
  -inline datastream<Stream>& operator<<(datastream<Stream>& ds, const uint128_t d) {
  +inline datastream<Stream>& operator<<(datastream<Stream>& ds, const uint128_t& d) {
  ds.write( (const char*)&d, sizeof(d) );
  return ds;
  }
  @@ -187,7 +188,7 @@ inline datastream<Stream>& operator>>(datastream<Stream>& ds, uint128_t& d) {
  * @param d value to serialize
  */
  template<typename Stream>
  -inline datastream<Stream>& operator<<(datastream<Stream>& ds, const int128_t d) {
  +inline datastream<Stream>& operator<<(datastream<Stream>& ds, const int128_t& d) {
  ds.write( (const char*)&d, sizeof(d) );
  return ds;
  }
  @@ -413,6 +414,29 @@ inline datastream<Stream>& operator>>(datastream<Stream>& ds, uint8_t& d) {
  return ds;
  }
  +/**
  + * Serialize a checksum256 into a stream
  + * @brief Serialize a checksum256
  + * @param ds stream to write
  + * @param d value to serialize
  + */
  +template<typename Stream>
  +inline datastream<Stream>& operator<<(datastream<Stream>& ds, const checksum256& d) {
  + ds.write( (const char*)&d, sizeof(d) );
  + return ds;
  +}
  +/**
  + * Deserialize a checksum256 from a stream
  + * @brief Deserialize a checksum256
  + * @param ds stream to read
  + * @param d destination for deserialized value
  + */
  +template<typename Stream>
  +inline datastream<Stream>& operator>>(datastream<Stream>& ds, checksum256& d) {
  + ds.read((char*)&d, sizeof(d) );
  + return ds;
  +}
  +
  template<typename DataStream>
  DataStream& operator << ( DataStream& ds, const std::string& v ) {
  ds << unsigned_int( v.size() );
  @@ -485,6 +509,28 @@ DataStream& operator >> ( DataStream& ds, vector<T>& v ) {
  return ds;
  }
  +template<typename DataStream, typename T, typename U>
  +DataStream& operator << ( DataStream& ds, const std::map<T,U>& v ) {
  + ds << unsigned_int( v.size() );
  + for( const auto& i : v ) {
  + ds << i.first;
  + ds << i.second;
  + }
  + return ds;
  +}
  +
  +template<typename DataStream, typename T, typename U>
  +DataStream& operator >> ( DataStream& ds, std::map<T,U>& v ) {
  + unsigned_int s;
  + ds >> s;
  + for (uint32_t i = 0; i < s; ++i) {
  + T t;
  + ds >> t;
  + ds >> v[t];
  + }
  + return ds;
  +}
  +
  template<typename T>
  T unpack( const char* buffer, size_t len ) {
  T result;
  