TArray Iterator NotEqual Operator Not Working

Hi,

since UE 4.7 the following code is not working anymore:

TArray<AActor*>::TConstIterator iter = mArray.CreateConstIterator();
for (; iter != NULL; ++iter)
{
	// do anything
}

The compiler complains that the operator != is not defined for the iterator.
For UE 4.6 this was all working fine.

Does anybody know why and can give me a solution?

Thanks,
Julian

There is an operator != for iterators but it is only to compare two iterators, which NULL doesn’t convert to. But to fix this all you should need to have is:

for (; iter; ++iter)