diff options
author | VoR0220 <rj@erisindustries.com> | 2016-11-18 08:01:28 +0800 |
---|---|---|
committer | VoR0220 <rj@erisindustries.com> | 2016-11-18 11:35:54 +0800 |
commit | 9dda8f7d84d50a974b6de759a543f001803d9028 (patch) | |
tree | d2862140aa88b15a8c9af7cb7170285b7c907f72 /libdevcore | |
parent | b46a14f4a8e128c08336763abf8bbf7c111f464d (diff) | |
download | dexon-solidity-9dda8f7d84d50a974b6de759a543f001803d9028.tar.gz dexon-solidity-9dda8f7d84d50a974b6de759a543f001803d9028.tar.zst dexon-solidity-9dda8f7d84d50a974b6de759a543f001803d9028.zip |
add ostream to bytes for ease of development
Signed-off-by: VoR0220 <rj@erisindustries.com>
fix up
Signed-off-by: VoR0220 <rj@erisindustries.com>
Diffstat (limited to 'libdevcore')
-rw-r--r-- | libdevcore/Common.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libdevcore/Common.h b/libdevcore/Common.h index d65cfeac..dababe79 100644 --- a/libdevcore/Common.h +++ b/libdevcore/Common.h @@ -135,6 +135,16 @@ inline u256 s2u(s256 _u) return u256(c_end + _u); } +inline std::ostream& operator<<(std::ostream& os, bytes const& _bytes) +{ + std::ostringstream ss; + 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); |