mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-20 18:40:51 +00:00
Common/Swap: Amend BigEndianValue's operator= to return a reference to the object rather than returning void
The general convention is to return a reference to the object that was acted on, otherwise you can get into situations with errors because the type wasn't being propagated properly
This commit is contained in:
parent
75574b7b97
commit
88a80f118c
@ -174,7 +174,12 @@ struct BigEndianValue
|
|||||||
BigEndianValue() = default;
|
BigEndianValue() = default;
|
||||||
explicit BigEndianValue(value_type val) { *this = val; }
|
explicit BigEndianValue(value_type val) { *this = val; }
|
||||||
operator value_type() const { return FromBigEndian(raw); }
|
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:
|
private:
|
||||||
value_type raw;
|
value_type raw;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user