Reference Link: http://blog.jobbole.com/79228/
1 return type deduction
In c++11, the lambda function parameter needs to be declared as a specific type. C++14 relaxed this requirement, allowing the lambda function parameter type to use the type specifier auto. The code is concise and can enhance refactoring. Actual use of template parameters
Auto lambda = [] (auto x, auto y) {return (x + y);} // equivalent to struct <typename t,typename u>operatorconst{return (x+ = Unnamed_lambda ();
If a function has more than one return path, the value returned by each return path needs to have the same type.
Auto F (int i) { if0 ) return -1; Else return 2.0 // compile will error }
2
A lambda capture that can be initializedCaptures in lambda can be initialized, separated by commas, run from left to rightauto y = [&r = x, x = X+1] (->int {. /span> 3
[[deprecated]] propertyThe [[deprecated]] label is placed in front of the declaration-it can be a declaration of a class, variable, function, or some other entity, and is placed before the entity name, such as the Class,enum keyword. Flag obsolete definitions, not recommended
class [[deprecated]] flaky {}; [[Deprecated ("consider using something other than cranky")]] int cranky () { return0int main () { flaky F; return cranky ();}
Other
Binary constants are preceded by a prefix of 0b (or 0B), followed by a binary number.
Single quote character as a number separator, 1 million can be: 1 ' 000 ' 000.00 or 1 ' 0 ' 00 ' 0 ' 00.00
#include <iostream>intMain () {intval =0b11110000; Std::cout<<"Output Mask:"<< 0b1000'0001' +'0000<<"\ n"; Std::cout<<"proposed salary: $"<< -'000.00<<"\ n"; return 0;}
New features for C + + 14