您的位置:首页 > 编程语言 > C语言/C++

主要几个发行版的 gcc 对 c++ 新标准的支持情况区别

2016-03-31 15:35 656 查看
纯自用总结,无任何技术含量,
结论是,基本没区别。。。。

目前常用的系统:
debian系的
与centOS7对应的 ubuntu14.04LTS

g++ (Ubuntu 4.8.4-2ubuntu1~14.04.1) 4.8.4

最新的16.04LTS

g++ (Ubuntu 5.3.1-10ubuntu2) 5.3.1 20160225

---------------------------------------------------
查看redhat系列的版本:
cat /etc/redhat-release
CentOS Linux release 7.1.1503 (Core)

公司使用centOS6.3 的:
g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16)
太老了,逐步迁移出来ing,不看也罢。

公司使用centOS7.1 的:
g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)
未来几年内主要使用的生产平台

-----------------------------------------------------
g++从4.8开始支持--std=c++11 (c++1x = c++11,1y=14,1Z=17)

14.04 4.8.4
cent7 4.8.5
4.8.0 thread_local
[[noreturn]] void f(); 属性器语法
alignas(double) int i; alignment specifier
inheriting constructors:
struct A { A(int); };
struct B: A { using A::A; }; // defines B::B(int)
B b(42); // OK

4.8.1 decltype ref-qualifiers

4.9 ISO C11 : _Atomic <stdatomic.h> _Generic _Thread_local __auto_type
C++1y :decltype(auto)
[[deprecated]]
lambda capture initializers
[x = 42]{ ... };
digit separators
generic (polymorphic) lambdas.
libstdc++:std::make_unique

16.04 5.3.1 ISO C11 : default mode for C is now -std=gnu11 instead of -std=gnu89
c++14 : variable templates
extended constexpr

g++5最重要的:
A new implementation of std::string is enabled by default, using the small string optimization instead of copy-on-write reference counting.
A new implementation of std::list is enabled by default, with an O(1) size() function;
难以置信list坚持不缓存size,直到5.0版本。。。。。

Full support for C++11, including the following new features:

std::deque and std::vector<bool> meet the allocator-aware container requirements;
movable and swappable iostream classes;
support for std::align and std::aligned_union;
type traits std::is_trivially_copyable, std::is_trivially_constructible, std::is_trivially_assignable etc.;
I/O manipulators std::put_time, std::get_time, std::hexfloat and std::defaultfloat;
generic locale-aware std::isblank;
locale facets for Unicode conversion;
atomic operations for std::shared_ptr;
std::notify_all_at_thread_exit() and functions for making futures ready at thread exit.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: