I've noticed that in VC++ the intellisense doesn't fire up for instances of classes or structs defined locally inside a function. Is there some reasoning behind this or is it just a shortcoming of VC++?
I've noticed that in VC++ the intellisense doesn't fire up for instances of classes or structs defined locally inside a function. Is there some reasoning behind this or is it just a shortcoming of VC++?
And if a struct is defined locally in a function, do you really need the IDE to tell you the names of members?
Steady on guys, I'm just exploring the language!
Actually I noticed this in the course of going through one of the many exercises at the end of each chapter of Bruce Eckel's "Thinking in C++." He has you doing all sorts of things...define this class here, define this struct there, create an instance of this class in this function....see what the compiler tells you....define this globally instead and see what the compiler tells you now....
Etc.
And in the process I noticed that Intellisense doesn't work when you define a type in a function and since I'm a beginner with a naturally curious outlook, I wondered whether there was some reasoning behind this or whether it was just a bug. As it happens I've since come across a bug report for this very issue on the Microsoft site. It was reported in 2006 and the response was that they don't have the time or resources to fix it.
There it goes again! I said nothing to even insinuate that I was using Intellisense to explore the language. I made it very clear that I was curious about something I had discovered about Intellisense in the course of exploring the language.
Cripes, I'd hate to have to debug one of YOUR programs![]()
Okay guys... I think we've reached a conclusion here. Intellisense has trouble with function-local data types.
I was curious why you were doing this, because it's pretty unorthodox. "Exploring the language" is as good a reason as any.
Code://try //{ if (a) do { f( b); } while(1); else do { f(!b); } while(1); //}
Every now and then it'll annoy me by hiding something I want to glance at while I'm typing. For instance, a line of code below the one I'm working on. But the pros outweigh the cons. It's actually a great learning tool for a beginner because, for instance, it indicates when you've passed an argument correctly into a function. However every now and then I find it doesn't work first time for some reason....then I'll go back and delete the object name and type it again and it does work.