mirror of
https://github.com/changkun/modern-cpp-tutorial.git
synced 2025-12-17 04:34:40 +03:00
23 lines
398 B
C++
23 lines
398 B
C++
//
|
|
// 7.7.is.lock.free.cpp
|
|
// chapter 7 parallelism and concurrency
|
|
// modern c++ tutorial
|
|
//
|
|
// created by changkun at changkun.de
|
|
// https://github.com/changkun/modern-cpp-tutorial
|
|
//
|
|
|
|
#include <atomic>
|
|
#include <iostream>
|
|
|
|
struct A {
|
|
float x;
|
|
int y;
|
|
long long z;
|
|
};
|
|
|
|
int main() {
|
|
std::atomic<A> a;
|
|
std::cout << std::boolalpha << a.is_lock_free() << std::endl;
|
|
return 0;
|
|
} |