Iterators - more than one instance of "begin" after 4.7.6 update

Hi,

after upgrade to version 4.7.6, I started to get following error in Visual Studio:

I have following code:



// .h file
TArray<AActor*> Created; 

// .cpp file
for (auto instance : Created)
{
	if (instance && instance->IsValidLowLevel())
		instance->Destroy();
}


Although, I am able to compile and run my project, it is very frustrating to see errors where none of them are (usually I see 54 errors from IntelliSense).

Can you tell me, what is wrong? Or it’s some bug? Thank you a lot!

This is very frustrating indeed. Are there any plans on fixing that?

Intellisense is notoriously bad at parsing templates (which you can’t really blame it), honestly the best thing I’ve found is to find disable intellisense errors. The compiler is the authority on errors anyway.

See this thread:

As far as I know, at some point Intellisense started to “understand” UE specific things. Right now I’m using it and it works with everything except that new bug with iterators templates. I really hope it will be fixed in the next releases.

I’m not seeing any issue with Iterators on my end (been using them profusely recently).

I highly recommend Visual Assist X to avoid false positives (possibly what this is). Honestly once you get it you’ll wonder how you got by without it! Worth every penny :slight_smile: