Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 CppCon 2014 上,Herb Sutter 描述了使用原子共享 ptr的ABA 问题的简洁解决方案。此解决方案的摘要可在本文底部找到。然而,atomicon的部分特化shared_ptr是传入 C++20 的一个特性(参见此处)。有没有办法使用 C++14 优雅地解决问题?
atomic
shared_ptr