Possible Duplicate:
How much is too much with C++0x auto keyword
The new keyword “auto”; When should it be used to declare a variable type?
In C++11, Typing a variable auto
instead of, say, int
, will let the compiler automatically use the right type, deduced from its initialization context. This comes super handy in situations where the type is obvious but boring to write. Are there pitfalls to be aware of, or reasons why someone would avoid using that?