diff options
-rw-r--r-- | libdevcore/Common.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libdevcore/Common.h b/libdevcore/Common.h index d65cfeac..225f38ac 100644 --- a/libdevcore/Common.h +++ b/libdevcore/Common.h @@ -135,6 +135,17 @@ inline u256 s2u(s256 _u) return u256(c_end + _u); } +inline std::ostream& operator<<(std::ostream& os, bytes const& _bytes) +{ + std::ostringstream ss; + ss << std::hex; + std::copy(_bytes.begin(), _bytes.end(), std::ostream_iterator<int>(ss, ",")); + std::string result = ss.str(); + result.pop_back(); + os << "[" + result + "]"; + return os; +} + template <size_t n> inline u256 exp10() { return exp10<n - 1>() * u256(10); |