摘要: 1 #include <iostream> 2 using namespace std; 3 4 //定义一个宏开关 5 #define __SWITCH__ 6 7 8 int main() 9 { 10 #ifdef __SWITCH__ 11 //如果定义了__SWITCH__开则执行下列代码 阅读全文
posted @ 2019-07-31 23:05 main(0) 阅读(1466) 评论(0) 推荐(0)
摘要: 一、std::atomic续谈 上一章说到std::atomic是针对一个变量的,这里补充一下针对的变量操作一般是++,+=,--,&=等等运算 。以下这种不可取:a=a+1; 二、std::async与std::std::thread的区别 1.std::async第一个参数为std::lauch 阅读全文
posted @ 2019-07-31 22:07 main(0) 阅读(154) 评论(0) 推荐(0)