Monthly Archives: April 2017



code
Syntax [crayon-5cb9e6dd88d00217101818/]   [crayon-5cb9e6dd88d14693803604/] Note: the code from above is no longer necessary in C++14, the compiler will deduce the return type.   Usage / Usability Capture list [] take none of the variables from the enclosing scope [&] take all the variables from the enclosing scope by reference [=] […]

General features: lambda expressions


code
Syntax [crayon-5cb9e6dd8920b831412771/] Usage / Usability Type deduction happens at compile time Auto ignores references and const/volatile Hard to write [crayon-5cb9e6dd89215974652631/]   Hard to know [crayon-5cb9e6dd8921b779132667/] PROS No more uninitialized variables, no more hidden bugs [crayon-5cb9e6dd89220336889516/] avoid problems related to “type shortcuts” [crayon-5cb9e6dd89226521946216/] std::vector<int>::size_type is specified to be an unsigned integral […]

General features: Auto specifier