Non-Atomic Equivalent of std::shared_ptr and Why It's Absent in
std::shared_ptr has gained prominence as the atomically incrementing and decrementing shared ownership smart pointer. However, the question arises of whether a non-atomic equivalent exists.
1. Non-Atomic Alternative Options
Despite extensive examination of the
2. Why a Non-Atomic std::shared_ptr Was Not Included in C 11
The absence of a non-atomic version in C 11 stems from discussions held during the Rapperswil meeting in 2010.
Reasons Against Non-Atomic Option:
Based on these arguments, the Language Working Group (LWG) decided against introducing a non-atomic variant of shared_ptr in C 11.
The above is the detailed content of Why Doesn\'t C Have a Non-Atomic `std::shared_ptr`?. For more information, please follow other related articles on the PHP Chinese website!