Open avidele opened 4 months ago
0>EnumRegistry.cpp(31,25): Error : loop variable 'Pair' creates a copy from type 'const PairType' (aka 'const TTuple<FString, FEnumDesc >') [-Werror,-Wrange-loop-construct] 0> for (const auto Pair : Name2Enums) 0> ^ 0>EnumRegistry.cpp(31,14): Reference : use reference type 'const PairType &' (aka 'const TTuple<FString, FEnumDesc > &') to prevent copying 0> for (const auto Pair : Name2Enums) 0> ^~~~~ 0> & 0>1 error generated.
Hi @avidele Have you managed to fix this issue? I encounter the same issue
Hi all, One solution is presented here: issue #693 For this error, simplest solution is just add a &, like const auto& Pair... in line 31.
0>EnumRegistry.cpp(31,25): Error : loop variable 'Pair' creates a copy from type 'const PairType' (aka 'const TTuple<FString, FEnumDesc >') [-Werror,-Wrange-loop-construct] 0> for (const auto Pair : Name2Enums) 0> ^ 0>EnumRegistry.cpp(31,14): Reference : use reference type 'const PairType &' (aka 'const TTuple<FString, FEnumDesc > &') to prevent copying 0> for (const auto Pair : Name2Enums) 0> ^![图片](https://github.com/Tencent/UnLua/assets/125431167/33b73317-020c-43df-84a8-b37c72f2b328)
~~~~ 0> & 0>1 error generated.