Skip to content

Commit

Permalink
Return *this from an assignment operator
Browse files Browse the repository at this point in the history
  • Loading branch information
kcat committed Jun 21, 2024
1 parent f91c044 commit 3c9cb48
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions alc/backends/wasapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,14 @@ struct PropVariant {
public:
PropVariant() { PropVariantInit(&mProp); }
PropVariant(const PropVariant &rhs) : PropVariant{} { PropVariantCopy(&mProp, &rhs.mProp); }
PropVariant(PropVariant&& rhs) : PropVariant{} { PropVariantCopy(&mProp, &rhs.mProp); }
~PropVariant() { clear(); }

void operator=(const PropVariant &rhs) { PropVariantCopy(&mProp, &rhs.mProp); }
void operator=(PropVariant&& rhs) { PropVariantCopy(&mProp, &rhs.mProp); }
auto operator=(const PropVariant &rhs) -> PropVariant&
{
if(this != &rhs)
PropVariantCopy(&mProp, &rhs.mProp);
return *this;
}

void clear() { PropVariantClear(&mProp); }

Expand Down

0 comments on commit 3c9cb48

Please sign in to comment.