Add operator+() to uint256.

This commit is contained in:
Arthur Britto
2012-07-09 18:01:36 -07:00
parent 86e5c77b8b
commit d6f18a9195

View File

@@ -138,6 +138,20 @@ public:
return ret;
}
base_uint& operator+=(const base_uint& b)
{
uint64 carry = 0;
for (int i = 0; i < WIDTH; i++)
{
uint64 n = carry + pn[i] + b.pn[i];
pn[i] = n & 0xffffffff;
carry = n >> 32;
}
return *this;
}
std::size_t hash_combine(std::size_t& seed) const
{
for (int i = 0; i < WIDTH; ++i)