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.
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.