C++ 14
作者:
fck_13 | 来源:发表于
2020-05-06 18:26 被阅读0次
如果是C++11是一个大的release的话,那C++14充其量只不过是一个hotfix。不知道是不是因为C++11添加改动的东西太多而导致了C++14的小规模改动。
英文 |
中文 |
简短的解释 |
Tweaked wording for contextual conversions |
按语境转换的遣词调整 |
new 表达式,delete 表达式,const 表达式和switch 表达式中的隐式转换 |
Binary literals |
二进制常量 |
十六进制常量:0x1f , 十进制常量:52 ,八进制常量:052 ,二进制常量:0b10
|
decltype(auto), Return type deduction for normal functions |
decltype(auto)普通函数的反回类型推倒 |
|
Initialized/Generalized lambda captures (init-capture) |
带初始化/泛化的lambda捕获(init-capture) |
|
Generic (polymorphic) lambda expressions |
泛型(多态)lambda表达式 |
|
Variable templates |
变量模板 |
给变量也加上了模板,template <class T> T pi = T{3.1415926}; pi<int> 是一个整型的pi,其值为3 ,pi<double> 为浮点型的pi,其值为 3.1415926
|
Extended constexpr
|
扩展的constexpr
|
|
Member initializers and aggregates (NSDMI) |
成员初始化器与聚合体 |
struct X { int i, j, k = 42; };X a[] = { 1, 2, 3, 4, 5, 6 }; X b[2] = { { 1, 2, 3 }, { 4, 5, 6 } }; a 和b 的值相同 |
Clarifying memory allocation (avoiding/fusing allocations) |
澄清内存分配(分配的免除/融合) |
内存分配的宏观上的优化 |
[[deprecated]] attribute |
[[deprecated]]属性 |
告诉使用者这个函数或者对象之类的后期将不在使用 |
Sized deallocation |
具有大小的回收 |
增加两个delete的全局函数,该函数有一个size_t 参数,为了提高性 |
Single quote as digit separator |
单引号作为数位分分隔符 |
给数字常量添加分隔符,方便阅读 |
英文 |
中文 |
简短的解释 |
constexpr for <complex> |
|
给complex的一些函数添加了constexpr 修饰 |
std::result_of and SFINAE |
|
|
constexpr for <chrono> |
|
|
constexpr for <array> |
|
|
constexpr for <initializer_list>, <utility> and <tuple> |
|
|
Improved std::integral_constant |
|
|
User-defined literals for <chrono> and <string> |
|
|
Null forward iterators |
|
|
std::quoted |
|
|
Heterogeneous associative lookup |
|
|
std::integer_sequence |
|
|
std::shared_timed_mutex |
|
|
std::exchange |
|
|
fixing constexpr member functions without const |
|
|
std::get<T>() |
|
|
Dual-Range std::equal, std::is_permutation, std::mismatch |
|
|
本文标题:C++ 14
本文链接:https://www.haomeiwen.com/subject/htqlhhtx.html
网友评论