Home >Backend Development >C++ >Why isn't there a `std::shared_ptr` in the C standard library?
A Deeper Dive into the Absence of std::shared_ptr
In the C standard library, there exists a specialized version of std::unique_ptr for arrays, std::unique_ptr
Rationale for the Lack of Specialization
The absence of std::shared_ptr
Current Status and Future Prospects
Despite the historical hesitation, recent discussions have reignited interest among LWG members. While a prototype has been implemented, a formal proposal remains outstanding. The feasibility and ultimate adoption of std::shared_ptr
Upcoming Developments
An open-std.org draft TS (Technical Specification) proposes array support for std::shared_ptr. This TS, if adopted, would introduce std::shared_ptr
Update for C 17
The draft TS has since been incorporated into C 17, providing official support for std::shared_ptr
The above is the detailed content of Why isn't there a `std::shared_ptr` in the C standard library?. For more information, please follow other related articles on the PHP Chinese website!