Why tediously tell the compiler what it already knows?
• void Print( const map<int,string>& m ) {
map<int,string>::const_iterator i = m.begin();
…
}
• void Print( const map<int,string>& m ) {
auto i = m.begin();
…
}
Commonality:
•Already voted into ISO
C++0x. A significant and
broadly applicable
convenience, esp. with generic programming.
•Directly leveraged in
Concur and Linq. Helps
enable an elegant
syntax for Concur active lambda functions. The Linq programmer shouldn’t be required to,
and often can’t, write the names of lots of complex anonymous types that get generated on the fly.