What can I do to get geometrycore's dynamicvector.h to compile? (UE5-main)

Hi. About 3 days ago this commit to ue5-main branch (4-27 was the closest version tag I could find, but I am using the ue5-main branch) broke my ability to compile the engine. I think I understand what the offending code does, and I have no idea why it wouldn’t be working.

https://github.com/EpicGames/UnrealEngine/commit/e8c5a8d3b0bdf7af0d633265ea7d8a73368b7790

The error comes up for anything trying to use the dynamic vector template.

In TDynamicVector::Serialize_LegacyLoad:

const auto SerializeElement =
				TCanBulkSerialize<Type>::Value && !(bIsLWCBulkSerializedDoubleType && Ar.UEVer() < EUnrealEngineObjectUE5Version::LARGE_WORLD_COORDINATES)
					? [](FArchive& Archive, ArrayType* Element)
					{
						Archive.Serialize(Element->GetData(), Element->Num() * sizeof(Type));
					}
					: [](FArchive& Archive, ArrayType* Element)
					{
						Archive << *Element;
					};

This appears to be setting it to a lambda based on a condition, checks out to me, but this is what VS2022 is telling me:

24>[2663/5737] Compile Module.GeometryProcessingAdapters.cpp
24>E:\UE5-main\UnrealEngine\Engine\Source\Runtime\GeometryCore\Public\Util\DynamicVector.h(420): error C2446: ':': no conversion from 'UE::Geometry::TDynamicVector<int>::TBlockVector<TStaticArray<Type,512,4>>::Serialize_LegacyLoad::<lambda_6aec5ebeafd7b68c20482beffa040df2>' to 'UE::Geometry::TDynamicVector<int>::TBlockVector<TStaticArray<Type,512,4>>::Serialize_LegacyLoad::<lambda_a92b53eba8abd370a3657bcba34e9c59>'
24>        with
24>        [
24>            Type=int
24>        ]
24>E:\UE5-main\UnrealEngine\Engine\Source\Runtime\GeometryCore\Public\Util\DynamicVector.h(420): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
24>E:\UE5-main\UnrealEngine\Engine\Source\Runtime\GeometryCore\Public\Util\DynamicVector.h(397): note: while compiling class template member function 'void UE::Geometry::TDynamicVector<int>::TBlockVector<TStaticArray<Type,512,4>>::Serialize_LegacyLoad(FArchive &)'
24>        with
24>        [
24>            Type=int
24>        ]
24>E:\UE5-main\UnrealEngine\Engine\Source\Runtime\GeometryCore\Public\Util\DynamicVector.h(160): note: see reference to function template instantiation 'void UE::Geometry::TDynamicVector<int>::TBlockVector<TStaticArray<Type,512,4>>::Serialize_LegacyLoad(FArchive &)' being compiled
24>        with
24>        [
24>            Type=int
24>        ]
24>E:\UE5-main\UnrealEngine\Engine\Source\Runtime\GeometryCore\Public\Util\DynamicVector.h(576): note: see reference to class template instantiation 'UE::Geometry::TDynamicVector<int>::TBlockVector<TStaticArray<Type,512,4>>' being compiled
24>        with
24>        [
24>            Type=int
24>        ]
24>E:\UE5-main\UnrealEngine\Engine\Source\Runtime\GeometryCore\Public\Util\RefCountVector.h(622): note: see reference to class template instantiation 'UE::Geometry::TDynamicVector<int>' being compiled
24>E:\UE5-main\UnrealEngine\Engine\Source\Runtime\GeometryCore\Public\Util\DynamicVector.h(411): error C2737: 'SerializeElement': const object must be initialized
24>E:\UE5-main\UnrealEngine\Engine\Source\Runtime\GeometryCore\Public\Util\DynamicVector.h(431): error C3536: 'SerializeElement': cannot be used before it is initialized
24>E:\UE5-main\UnrealEngine\Engine\Source\Runtime\GeometryCore\Public\Util\DynamicVector.h(431): error C2064: term does not evaluate to a function taking 2 arguments

Basically, it can’t figure out what to do with the 2 lambdas, for some reason, and that variable never gets initialized.

Things to note:
Fresh install of vs2022, got all the win 10 sdks and .net sdks up to 6
I am not editing this code at all, I’m just trying to build it so I can experiment with the new Mass plugins
It was building just fine up until this commit happened, that broke it here
I ran setup and generate project files bat files after pulling, which I did twice today
Windows build, on Windows 10
Rebuild was used each attempt, not a partial compile

I am going to assume code that was checked in 3 days ago, with dozens of commits since, is actually meant to work as is and the problem is on my end. Am I missing a compiler setting or something? As far as I can tell, this is the most significant part of the error:

error C2446: ':': no conversion from 'UE::Geometry::TDynamicVector<int>::TBlockVector<TStaticArray<Type,512,4>>::Serialize_LegacyLoad::<lambda_6aec5ebeafd7b68c20482beffa040df2>' to 'UE::Geometry::TDynamicVector<int>::TBlockVector<TStaticArray<Type,512,4>>::Serialize_LegacyLoad::<lambda_a92b53eba8abd370a3657bcba34e9c59>'

Thankfully, I do not need the engine to actually run for a little bit, but I would really like to be able to build again in a few days. Please help.

same here.
with VS 2019

1 Like

If you are building ue5-main you should really get vs2022 and .net sdk 6 because one of the projects relies on it. IIRC its not a very important project, but you’ll have that issue with it if you don’t.

This particular issue seems to have been subject to a commit, FWIW, I’ll be marking this resolved. Thank you for fixing it, Epic! Good to know it wasn’t the tools.

https://github.com/EpicGames/UnrealEngine/commit/826fff9aa7fcf13de52e992e6fc1664c34c71087

They added some static casts to resolve the ambiguity.