当前位置:网站首页>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边栏推荐
猜你喜欢

LeetCode二叉树系列——226.翻转二叉树

sentinel与nacos持久化

How to grab configuration information for DELL SC compellent storage system

看交互设计如何集成到Scrum敏捷流程中

Introductory UnityShader learning (2) - the rendering pipeline
![MySQL [aggregate function]](/img/2e/8f92cedeb8c2a99ec682869c77bc67.png)
MySQL [aggregate function]

架构实战营模块8消息队列表结构设计

分成两栏后文字顺序混乱的问题解决【写期刊论文时】

UnityShader入门学习(三)——Unity的Shader

Redis与分布式:集群搭建
随机推荐
Combination series - there are combinations when there are arrangements
OpenShift 4 - 用 Operator 部署 Redis 集群
R语言ggstatsplot包ggbarstats函数可视化条形图、并添加假设检验结果(包含样本数、统计量、效应大小及其置信区间、显著性、组间两两比较、贝叶斯假设)、检验结果报告符合APA标准
RecyclerView的高效使用第一节
自适应控制——仿真实验三 用超稳定性理论设计模型参考自适应系统
Sentinel服务熔断和降级
Introduction to BigDecimal, common methods
Sentinel限流和异常处理
The JVM a class loader
MySQL 23 classic interviews hang the interviewer
梅克尔工作室-第一次
力扣:56. 合并区间
How to grab configuration information for DELL SC compellent storage system
分成两栏后文字顺序混乱的问题解决【写期刊论文时】
TRACE32——常用操作
SetoolKit User Guide
Advanced Mathematics - Commonly Used Indefinite Integral Formulas
Nuget打包并上传教程
The recently popular domestic interface artifact Apipost experience
RecyclerView高效使用第二节