当前位置:网站首页>Destruction order of thread_local variables
Destruction order of thread_local variables
2022-07-31 14:57:00 【maray】
#include class C1{public:C1() { printf("c1cons\n"); }~C1() { printf("c1des\n"); }};class C2{public:C2() { printf("c2cons\n"); }~C2() { printf("c2des\n"); }};int main(int argc, const char *argv[]){thread_local C1 c1;thread_local C2 c2; // C2 is expected to be post-constructed and destructed first.Because semantically c2 may depend on c1 (eg c1 is a construction parameter of c2)return 0;}
Output:
[xiaochu.yh test]$g++ test.cpp --std=c++11[xiaochu.yh test]$./a.outc1 consc2 consc2 desc1 des
边栏推荐
猜你喜欢
Recommendation System - Recall Phase - 2013: DSSM (Twin Towers Model) [Embedding (Semantic Vector) Recall] [Microsoft]
Architecture actual combat battalion module 8 message queue table structure design
The 232-layer 3D flash memory chip is here: the single-chip capacity is 2TB, and the transmission speed is increased by 50%
49. The copy constructor and overloaded 】
什么是消息队列呢?
OAuth2:资源服务器
LeetCode二叉树系列——222.完全二叉树的节点个数
分成两栏后文字顺序混乱的问题解决【写期刊论文时】
Ubantu专题4:xshell、xftp连接接虚拟机以及设置xshell复制粘贴快捷键
Combination series - there are combinations when there are arrangements
随机推荐
乡村基冲刺港交所:5个月期内亏2224万 SIG与红杉中国是股东
thread_local 变量的析构顺序
sentinel与nacos持久化
[Pytorch] F.softmax() method description
49. The copy constructor and overloaded 】
消息队列消息数据存储MySQL表设计
R语言的画图代码及差异性分析[通俗易懂]
Efficient use of RecyclerView Section 1
Getting started with UnityShader (3) - Unity's Shader
R语言ggplot2可视化:使用ggpubr包的ggboxplot函数可视化箱图、使用font函数自定义图例标题文本(legend.title)字体的大小、颜色、样式(粗体、斜体)
四象限时间管理有多好用?
Use of el-tooltip
AVH部署实践 (一) | 在Arm虚拟硬件上部署飞桨模型
Spark学习(3)-Spark环境搭建-Standalone
OAuth2:使用JWT令牌
Sentinel流量控制
看交互设计如何集成到Scrum敏捷流程中
格林美瑞交所IPO:募资3.8亿美元 更多中国企业将赴欧洲上市
NC | 斯坦福申小涛等开发数据可重复分析计算框架TidyMass
Prometheus之node_exporter性能监控信息采集含义