template<typename T>
static inline std::atomic<T>* From(T* v) noexcept
{
std::atomic<T>* p = static_cast<std::atomic<T>*>(static_cast<void*>(v));
std::atomic_init(p, *v);
return p;
}
C++ 11 int* 转换类型为 std::atomic<int>*
最新推荐文章于 2024-06-17 16:12:45 发布