Merge pull request #6610 from lioncash/swap

Common/Swap: Amend BigEndianValue's operator= to return a reference to the object rather than returning void
This commit is contained in:
Léo Lam 2018-04-08 10:22:10 +02:00 committed by GitHub
commit 3d10344561
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -174,7 +174,12 @@ struct BigEndianValue
BigEndianValue() = default;
explicit BigEndianValue(value_type val) { *this = val; }
operator value_type() const { return FromBigEndian(raw); }
void operator=(value_type v) { raw = FromBigEndian(v); }
BigEndianValue& operator=(value_type v)
{
raw = FromBigEndian(v);
return *this;
}
private:
value_type raw;
};