Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement P3323R1 Forbid atomic<cv T>, Specify atomic_ref<cv T> #5213

Merged
merged 14 commits into from
Jan 14, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
static_cast<_Ty> => static_cast<_TVal>
StephanTLavavej committed Jan 10, 2025
commit 32dd8fe12609df761edc07c37cf813646db2d494
10 changes: 5 additions & 5 deletions stl/inc/atomic
Original file line number Diff line number Diff line change
@@ -1806,11 +1806,11 @@ struct _Atomic_integral_facade<_Ty&> : _Atomic_integral<_Ty&> {
}

_TVal operator+=(const _TVal _Operand) const noexcept _REQUIRES_CLAUSE(!is_const_v<_Ty>) {
return static_cast<_Ty>(fetch_add(_Operand) + _Operand);
return static_cast<_TVal>(fetch_add(_Operand) + _Operand);
}

_TVal operator-=(const _TVal _Operand) const noexcept _REQUIRES_CLAUSE(!is_const_v<_Ty>) {
return static_cast<_Ty>(fetch_sub(_Operand) - _Operand);
return static_cast<_TVal>(fetch_sub(_Operand) - _Operand);
}

_TVal fetch_and(const _TVal _Operand) const noexcept _REQUIRES_CLAUSE(!is_const_v<_Ty>) {
@@ -1838,15 +1838,15 @@ struct _Atomic_integral_facade<_Ty&> : _Atomic_integral<_Ty&> {
}

_TVal operator&=(const _TVal _Operand) const noexcept _REQUIRES_CLAUSE(!is_const_v<_Ty>) {
return static_cast<_Ty>(fetch_and(_Operand) & _Operand);
return static_cast<_TVal>(fetch_and(_Operand) & _Operand);
}

_TVal operator|=(const _TVal _Operand) const noexcept _REQUIRES_CLAUSE(!is_const_v<_Ty>) {
return static_cast<_Ty>(fetch_or(_Operand) | _Operand);
return static_cast<_TVal>(fetch_or(_Operand) | _Operand);
}

_TVal operator^=(const _TVal _Operand) const noexcept _REQUIRES_CLAUSE(!is_const_v<_Ty>) {
return static_cast<_Ty>(fetch_xor(_Operand) ^ _Operand);
return static_cast<_TVal>(fetch_xor(_Operand) ^ _Operand);
}
};