语义没有区别.免费功能是尝试实现与C11的源兼容性:
#ifdef __cplusplus
#include <atomic>
#define _Atomic(X) std::atomic<X>
#else
#include <stdatomic.h>
#endif
_Atomic(int) c;
int get_c(void) {
return atomic_load(&c);
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
107 次 |
| 最近记录: |