he auto keyword presented here is related to another C++09 proposal: the decltype operator. decltype(e) retrieves the type of the expression e. By combining decltype and auto, you can simplify complex function declarations and reduce maintenance costs. The following sections will show you how to use decltypeto make your functions sing.
Your function consists of a simple return statement. Alas, the manual declaration of a complex return type makes your code brittle and illegible.
Use the decltypeoperator to extract the return type from an expression instead of spelling it out explicitly.