Proposal: Type inference for variable definition/initialization using the 'auto' keyword.

Ruslan Shevchenko rssh at
Fri May 15 20:23:17 PDT 2009

Sorry, can I ask what exactly patterns you mean.

I. e. is such approximation is correct (?)

  pattern for auto          : any variable definition.
  pattern for 'usefull' auto: any variable definition with
templates^H^H^H^H^H type parameters on left side.
  pattern for diamond       : any variable definition with allocation
expression at right side.

If this is correct, I will add one to set of coin patterns.

> You're right. These two classes are not statistically significant, but:
> - number of lines where "auto" can be used is always >= the number of
> lines where "diamond" can be used
> - you have probably written many thousands of lines in Java. Don't you
> have at least the feeling that there are at least 3-5 times more
>   variable definitions without object creation than with it?
> - (in case you do not have such feeling :-) I'd try to count lines on
> a larger source base.

More information about the coin-dev mailing list