@C++11 的新特性 对C++技术格局的影响

来源:互联网 发布:js动态增加style属性 编辑:程序博客网 时间:2024/04/29 11:59

C++ reference

From Cppreference

Jump to: navigation, search

FAQ

Language

PreprocessorKeywordsHeadersOperator precedenceEscape sequencesASCII chartFundamental types

Utilities library

Type support (basic types, RTTI, type traits)Dynamic memory managementError handlingProgram utilitiesDate and timebitsetFunction objectspairtuple (since C++11)

Strings library

basic_stringNULL-terminated byte stringsNULL-terminated multibyte stringsNULL-terminated wide strings

Containers library

array (since C++11)vectordequelistforward_list (since C++11)setmultisetmapmultimapunordered_set (since C++11)unordered_multiset(since C++11)unordered_map (since C++11)unordered_multimap(since C++11)stackqueuepriority_queue

Algorithms library

Iterators library

Numerics library

Common mathematical functionsComplex numbersPseudo-random number generation

Input/output library

basic_streambufbasic_filebufbasic_stringbufios_basebasic_iosbasic_istreambasic_ostreambasic_iostreambasic_ifstreambasic_ofstreambasic_fstreambasic_istringstreambasic_ostringstreambasic_stringstreamI/O manipulatorsC-style I/O

Localizations library

Regular expression library (since C++11)

Atomic operations library (since C++11)

Thread support library (since C++11)

Retrieved from "http://en.cppreference.com/w/cpp"
 
以上标有“since C++11”字样的是已经到来的新特性。
目前支持较好的是:
windows平台:              VS2010SP1以上版本
linux平台:                       GCC4.7以上版本
android以及arm平台:  交叉编译的gcc4.7以上版本
mac os x平台:               GCC4.7
 ios平台:                         或可用交叉编译的GCC4.7 
 
我比较关心的主要有:
1、容器里的unordered系列容器,里边有hash map等实现,不必再使用boost、stlport等库实现。
2、正则表达式regular express,不必使用boost等库。
3、原子操作库atomic operations,不必再使用其他的各种CAS CAS2 DCAS代码,最小代价拥有最高的并发效率。
4、线程支持库thread support,不必再纠结windows平台,到底使用_beginthread_还是CreateThread,linux平台的pthread。而且语言级支持跨平台。
 
就像html5一样,解决flash和native app的封闭,最终迎来在语言级跨平台代码的统一。
然而,具体情况要具体分析,盲目的套用新技术可能会带来新的问题。
其中最需依赖就是编译器的支持。