Talking about new lhs variables, the appropriate type could be derived from the right hand side expression. Eclipse does something along these lines, allowing to correct a type definition on an initialisation line. E. g. in double bar = 2.5;
int foo = 3*bar;
, the second line would be automatically transformed into double foo = 3*bar;
by invoking the right shortcut.
This becomes a lot more helpful when invoking functions that return objects of templated classes, such as std::list<MyClass>::const_iterator
, saving the time to look up the exact return type and actually typing it out!