template<typename T>
class asset_detail::atomic_shared_ptr< T >
Portable atomic-shared-ptr wrapper.
C++20 specifies a std::atomic<std::shared_ptr<T>> partial specialisation that works lock- free without requiring T to be trivially copyable. However, that specialisation only ships in libstdc++ >= 11 and libc++ >= 16 (older standard libraries fall back to the primary std::atomic<T> template, whose static_assert(__is_trivially_copyable(T)) fires because std::shared_ptr<X> – with its ref-count and non-trivial destructor – is NOT trivially copyable). On those older stdlibs we fall back to a plain std::shared_ptr<T> plus the C++11-era free-function atomics, which compile everywhere shared_ptr does. The free functions were deprecated in C++20, but they only entered the deprecation path on stdlibs that also ship the new specialisation – so the feature-test pivot below avoids the deprecation diagnostic in both branches.
API mirrors the subset of std::atomic<std::shared_ptr<T>> that asset_handle actually uses (.load() / .store() with explicit memory orders), so the rest of this header is unchanged.
Definition at line 41 of file asset_handle.h.