Skip to content
Permalink
Browse files
Merge pull request #6610 from lioncash/swap
Common/Swap: Amend BigEndianValue's operator= to return a reference to the object rather than returning void
  • Loading branch information
leoetlino committed Apr 8, 2018
2 parents 75574b7 + 88a80f1 commit 3d10344
Showing 1 changed file with 6 additions and 1 deletion.
@@ -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;
};

0 comments on commit 3d10344

Please sign in to comment.