add ostream to bytes for ease of development

Signed-off-by: VoR0220 <rj@erisindustries.com>

fix up

Signed-off-by: VoR0220 <rj@erisindustries.com>
This commit is contained in:
VoR0220 2016-11-17 18:01:28 -06:00
parent b46a14f4a8
commit 9dda8f7d84
No known key found for this signature in database
GPG Key ID: D4AB109D9B5D6386

View File

@ -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);