1

Is there a way to see the type of a variable declared with auto in Android Studio? In Eclipse you can see this by mouse over the auto keyword.

For example:

auto foo = 2.0F; // auto == float
auto bar = std::sqrt(25.0);  // auto == double

Edit: I am looking for an IDE solution, in this case Android studio. I would like Android Studio to tell me what is the deduced type of auto. Just like Eclipse shows you when you mouse over an auto keyword in code.

rozina
  • 4,120
  • 27
  • 49
  • IMHO this is an abuse of `auto`, but not really relevant I know. – Bathsheba Oct 12 '16 at 07:39
  • 1
    @Bathsheba I kinda like it, especially when combining ints, unsigned ints and such. With auto I don't get any implicit casts and with mouse over I can see what type the result will be. – rozina Oct 12 '16 at 07:40
  • Possible duplicate of [Is it possible to print a variable's type in standard C++?](http://stackoverflow.com/questions/81870/is-it-possible-to-print-a-variables-type-in-standard-c) – Richard Critten Oct 12 '16 at 07:44
  • @RichardCritten Not really. I am looking for an IDE solution, not a run time solution. – rozina Oct 12 '16 at 07:50

0 Answers0