New C++ template gives errors in UE5.1

As others have indicated intellisense often provides red herrings with Unreal build compiler errors. But the console error “code 6” just means the build failed. In my case I tried to do some fancy stuff with C++ 20 concepts (since UE 5 with VS2022 supports the C++ 20 standard) and templates and default template types with decltype and it was just too much for the MSVC VS 2022 compiler. Usually the console log shows the true error but in my case I think the compiler process ran out of memory as there was no other compiler error output in the console but I quickly got back to a working state by commenting out the new code and trying to rebuild again.