Post increment (operator++) operator is not overridden for data structure iteration when iterator is created with *.CreateConstIterator()

Probably a very simple matter and can be seen as unimportant. But I am an obsessed maniac so I had to write it :D.

When I like to iterate an Unreal data structure (i.e. a TMap, TSet etc.), I get a compile time error with the following code

for (auto i = someDT.CreateConstIterator(); i; i++) {
     foo(*i);
}

But it works if I pre-increment i

for (auto i = someDT.CreateConstIterator(); i; ++i) {
     foo(*i);
}

I’ve not tested it with all data structures but I can confirm that this happens with TMap. For non-const iterators created with “CreateIterator()” both versions work.

I am not sure if this is intentional but it seems like it is simply forgotten.

Hey Matiati-

Thank you for submitting a bug report. I have reproduced this issue and logged a report for it here Unreal Engine Issues and Bug Tracker (UE-43155) . You can track the report’s status as the issue is reviewed by our development staff. Please be aware that this issue may not be prioritized or fixed soon.

Cheers

I have the same issue if i use “CreateIterator()”.

I have vote to this issue. It’s not blocking issue but i lost few minute to find why the normal increment doesn’t work ?

With increment the project doesn’t compile

for (auto it = map.CreateIterator(); it; it++)
	{
		it->Value;
	}

With a pre increment it works

for (auto it = map.CreateIterator(); it; ++it)
{
	it->Value;
}

Engine version 4.15.3