对于 g++,它非常接近,至少对于基于 ELF 的系统而言。只需使用 编译 -Dthread_local=__thread 你就得到了大部分内容——唯一的问题是构造函数和析构函数没有被调用,但只要你对线程局部变量使用 POD 类型,这就不是问题。
With g++, its pretty close, at least for ELF-based systems. Just compile with -Dthread_local=__thread and you get most of it -- the only issue is contructors and destructors not being called, but as long as you use POD-types for your thread-local variables that's not an issue.
该标准仅在一个月前发布。我确信许多设计会议等在开始执行如此艰巨的任务之前正在进行。顺便说一句,大多数 C++ 编译器并不完全支持 C++98 版本的标准 - 所以请耐心等待。
The standard was published only a month ago. I am sure many design meetings etc are going on before they begin on such a huge task. By the way most c++ compilers dont completely support the C++98 version of the standard - so be patient.
发布评论
评论(2)
对于 g++,它非常接近,至少对于基于 ELF 的系统而言。只需使用
编译
-Dthread_local=__thread
你就得到了大部分内容——唯一的问题是构造函数和析构函数没有被调用,但只要你对线程局部变量使用 POD 类型,这就不是问题。With g++, its pretty close, at least for ELF-based systems. Just compile with
-Dthread_local=__thread
and you get most of it -- the only issue is contructors and destructors not being called, but as long as you use POD-types for your thread-local variables that's not an issue.该标准仅在一个月前发布。我确信许多设计会议等在开始执行如此艰巨的任务之前正在进行。顺便说一句,大多数 C++ 编译器并不完全支持 C++98 版本的标准 - 所以请耐心等待。
The standard was published only a month ago. I am sure many design meetings etc are going on before they begin on such a huge task. By the way most c++ compilers dont completely support the C++98 version of the standard - so be patient.