I\'ve just seen this really nice talk Rock Hard: C++ Evolving by Boris Jabes. In the section of the talk concerning Higher-Order Generic Programming he say
std::for_each(c.begin(), c.end(), [](decltype (c.front()) val){val*=2;});
Autodeducting the value_type of the container c can't be done without decltype.