However, decltype can be prodded into deducing a reference or non-reference type, based on the value category of the expression and the nature of the expression it is deducing:[5][3] C++14 adds the decltype(auto) syntax.
Their return values could be consumed by operations that require constant expressions, such as an integer template argument.
However, C++11 constexpr functions could only contain a single expression that is returned (as well as static_asserts and a small number of other declarations).
The usual rules of templates apply to such declarations and definitions, including specialization.
If the braced init list does not provide a value for that argument, the member initializer takes care of it.
The syntax is also used in other languages e.g. Java, C#, Swift, Go, Scala, Ruby, Python, OCaml, and as an unofficial extension in some C compilers since at least 2007.
[11] This can make it easier for human readers to parse large numbers through subitizing.
C++14 relaxes this requirement, allowing lambda function parameters to be declared with the auto type specifier.
C++11 lambda functions capture variables declared in their outer scope by value-copy or by reference.
This allows both capture by value-move and declaring arbitrary members of the lambda, without having a correspondingly named variable in an outer scope.
This can be used to capture by move, via the use of the standard std::move function: The deprecated attribute allows marking an entity deprecated, which makes it still legal to use but puts users on notice that use is discouraged and may cause a warning message to be printed during compilation.
[16] This would allow a map from std::string to some value to compare against a const char* or any other type for which an operator< overload is available.
It is also useful for indexing composite objects in a std::set by the value of a single member without forcing the user of find to create a dummy object (for example creating an entire struct Person to find a person by name).
[17] C++11 defined the syntax for user-defined literal suffixes, but the standard library did not use any of them.
The std::quoted stream I/O manipulator allows inserting and extracting strings with embedded spaces, by placing delimiters (defaulting to double-quotes) on output and stripping them on input, and escaping any embedded delimiters.