Attempting to use a post increment operator in a TMap or TSet iterator will fail to compile with error shown in callstack field. This is due to the post-increment operator not being overridden in Map.h. This is inconsistent with using a pre-increment operator which will compile/function as expected.
Regression:
No- same error message when attempting to use the code in 4.14.3 project
UPROPERTY(EditAnywhere, BlueprintReadWrite) TMap<int32,int32> TestMap;
for (auto i = TestMap.CreateConstIterator(); i; i++) {}
Result:
Compile will fail with error shown in callstack field
Expected:
Post increment is overridden and can be used/compiled
error C2676: binary '++': 'TMapBase<KeyType,ValueType,SetAllocator,KeyFuncs>::TConstIterator' does not define this operator or a conversion to a type acceptable to the predefined operator
Head over to the existing Questions & Answers thread and let us know what's up.
2 |
Component | UE - Foundation - Core |
---|---|
Affects Versions | 4.14.3, 4.15.1, 4.20 |
Created | Mar 21, 2017 |
---|---|
Resolved | Aug 18, 2021 |
Updated | Aug 18, 2021 |