Namespaces
Variants

std::atomic_ref<T>:: operator=

From cppreference.net
Concurrency support library
Threads
(C++11)
(C++20)
this_thread namespace
(C++11)
(C++11)
Cooperative cancellation
Mutual exclusion
Generic lock management
Condition variables
(C++11)
Semaphores
Latches and Barriers
(C++20)
(C++20)
Futures
(C++11)
(C++11)
(C++11)
Safe reclamation
Hazard pointers
Atomic types
(C++11)
(C++20)
Initialization of atomic types
(C++11) (deprecated in C++20)
(C++11) (deprecated in C++20)
Memory ordering
(C++11) (deprecated in C++26)
Free functions for atomic operations
Free functions for atomic flags
value_type operator = ( value_type desired ) const noexcept ;
(1) (C++26부터 constexpr)
atomic_ref & operator = ( const atomic_ref & ) = delete ;
(2)
1) store ( desired ) ; return desired ; 와 동등합니다. 이 오버로드는 std:: is_const_v < T > false 인 경우에만 오버로드 해결에 참여합니다.
2) atomic_ref CopyAssignable 이 아닙니다.

목차

매개변수

desired - value to assign

반환값

위에서 설명한 대로입니다.

참고 사항

대부분의 대입 연산자와 달리, atomic_ref 의 대입 연산자는 왼쪽 인수에 대한 참조를 반환하지 않습니다. 대신 저장된 값의 복사본을 반환합니다.

결함 보고서

다음의 동작 변경 결함 보고서들은 이전에 발표된 C++ 표준에 소급 적용되었습니다.

DR 적용 대상 게시된 동작 올바른 동작
LWG 3508
( P3323R1 )
C++20 대입 연산자가 const T 에 대해 무의미했음 비-const T 만 허용하도록 제약됨

참고 항목

atomic_ref 객체를 생성합니다
(public member function)
참조된 객체의 값을 비원자적 인수로 원자적으로 대체합니다
(public member function)