use of var

  • Thread starter Thread starter Peter
  • Start date Start date
Ajay said:
var reminds me of void* in C/C++. Unless there are advantages of using
it, I wouldnt use it.

Would it be like the auto keyword from C++0x?
 
Would it be like the auto keyword from C++0x?

It is precisely the same as plain "auto" in C++0x. It's more
restrictive, too - can only be used at local scope (C++0x auto works
for members, too), and you can't do partial inference (i.e. no
equivalent to e.g. "auto* x = &y").
 
Back
Top