主要几个发行版的 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.
结论是,基本没区别。。。。
目前常用的系统:
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.
相关文章推荐
- 用C++实现一个Brainfuck解释器
- C语言中以十六进制输出字符型变量会出现'ffffff"的问题
- 左值和右值/auto ptr智能指针
- C++继承与派生上机记录
- 在vs2010中编译log4cxx-0.10.0详细方法(从下载、编译、解决错误详细介绍)
- C++日志系统log4cxx使用总结
- C++ 读写文件方法--fstream,ofstream,ifstream
- C++学习基础
- C++:只用初始化列表初始化变量的几种情况
- 简单常用滤波算法C语言实现
- C++中的虚函数
- C++------------------------------------------------------------- 排序
- VS项目属性中C/C++运行库 、MT /MTd /MD /MDd
- C++primer第九章习题解答
- C++异常以及错误处理
- C++中冒号(:)和双冒号(::)的用法
- 【poj 1850】Code 题意&题解&代码(C++)
- 1026. 程序运行时间
- c++ 基础知识(1)
- 【C++】《C++标准程序库》小结第十三章-stream(2)