mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 13:07:46 +00:00
AK: Resolve clang-tidy warnings about unusual assignment operators
Either not returning *this, or in the case of Variant, not checking for self assignment. In AK::Atomic, we can't return *this due to the wrapper semantics Atomic implements.
This commit is contained in:
parent
22feb9d47b
commit
163367da39
3 changed files with 17 additions and 9 deletions
|
@ -187,6 +187,7 @@ public:
|
|||
return *ret;
|
||||
}
|
||||
|
||||
// NOLINTNEXTLINE(misc-unconventional-assign-operator) We want operator= to exchange the value, so returning an object of type Atomic& here does not make sense
|
||||
ALWAYS_INLINE T operator=(T desired) volatile noexcept
|
||||
{
|
||||
store(desired);
|
||||
|
@ -317,6 +318,7 @@ public:
|
|||
return __atomic_load_n(&m_value, order);
|
||||
}
|
||||
|
||||
// NOLINTNEXTLINE(misc-unconventional-assign-operator) We want operator= to exchange the value, so returning an object of type Atomic& here does not make sense
|
||||
ALWAYS_INLINE T operator=(T desired) volatile noexcept
|
||||
{
|
||||
store(desired);
|
||||
|
@ -417,6 +419,7 @@ public:
|
|||
return __atomic_load_n(&m_value, order);
|
||||
}
|
||||
|
||||
// NOLINTNEXTLINE(misc-unconventional-assign-operator) We want operator= to exchange the value, so returning an object of type Atomic& here does not make sense
|
||||
T* operator=(T* desired) volatile noexcept
|
||||
{
|
||||
store(desired);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue