当前位置:网站首页>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边栏推荐
- Jmeter常用的十大组件
- 基于最小二乘法和SVM从天气预报中预测太阳能发电量(Matlab代码实现)
- abaqus find contact pairs报错:surface name is already in use
- Web自动化实战——Selenium4(自动化测试环境的搭建)
- Introductory UnityShader learning (2) - the rendering pipeline
- 名创优品斥资6.95亿购买创始人叶国富所持办公楼股权
- The meaning of node_exporter performance monitoring information collection in Prometheus
- [QNX Hypervisor 2.2 User Manual] 9.13 rom
- NPM淘宝镜像(最新版本)于2021-11-21 16:53:52发布新版本npm镜像[通俗易懂]
- C language basic practice (nine-nine multiplication table) and printing different asterisk patterns
猜你喜欢
随机推荐
[QNX Hypervisor 2.2 User Manual] 9.13 rom
华医网冲刺港股:5个月亏2976万 红杉与姚文彬是股东
Selenium自动化中无头浏览器的应用
架构实战营模块8消息队列表结构设计
R language ggplot2 visualization: use the ggboxplot function of the ggpubr package to visualize the box plot, use the font function to customize the font size, color, style (bold, italic) of the legen
LeetCode二叉树系列——110.平衡二叉树
最小费用最大流问题详解
Advanced Mathematics - Commonly Used Indefinite Integral Formulas
ASP.NET Core 产生连续 Guid
Recommendation System - Recall Phase - 2013: DSSM (Twin Towers Model) [Embedding (Semantic Vector) Recall] [Microsoft]
Excel quickly aligns the middle name of the table (two-word name and three-word name alignment)
Architecture actual combat battalion module 8 message queue table structure design
OAuth2:资源服务器
[Pytorch] torch.argmax() usage
BigDecimal 简介,常用方法
NC | 中国农大草业学院杨高文组揭示发现多因子干扰会降低土壤微生物多样性的积极效应...
Synchronized和volatile 面试简单汇总
Sentinel安装与部署
UnityShader入门学习(三)——Unity的Shader
TRACE32——基于SNOOPer的变量记录









