Unable to create new Project or open a project of C++

I have recently updated my unreal engine from 4.12 to 4.13. After this update I am unable to create a new project using C++ option and when I try I am getting following message The project could not be compiled. Would you like to open it in Visual Studio?

Running D:/Program Files (x86)/Epic Games/4.13/Engine/Binaries/DotNET/UnrealBuildTool.exe Testing Development Win64 -project=“D:/Unreal/Testing/Testing.uproject” -editorrecompile -progress -noubtmakefiles -NoHotReloadFromIDE
@progress push 5%
Parsing headers for TestingEditor
Running UnrealHeaderTool “D:\Unreal\Testing\Testing.uproject” “D:\Unreal\Testing\Intermediate\Build\Win64\TestingEditor\Development\TestingEditor.uhtmanifest” -LogCmds=“loginit warning, logexit warning, logdatabase error” -Unattended -WarningsAsErrors -installed
Reflection code generated for TestingEditor in 2.9361363 seconds
@progress pop
Performing 8 actions (4 in parallel)
[2/8] Resource PCLaunch.rc
[3/8] Resource ModuleVersionResource.rc.inl
d:\program files (x86)\epic games\4.13\engine\source\runtime\core\public\delegates\Tuple.h(204): error C2275: ‘Types’: illegal use of this type as an expression
d:\program files (x86)\epic games\4.13\engine\source\runtime\core\public\delegates\Tuple.h(203): note: see declaration of ‘Types’
d:\program files (x86)\epic games\4.13\engine\source\runtime\core\public\delegates\Tuple.h(204): fatal error C1903: unable to recover from previous error(s); stopping compilation
INTERNAL COMPILER ERROR in ‘D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\cl.exe’
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information
ERROR: UBT ERROR: Failed to produce item: D:\Unreal\Testing\Binaries\Win64\UE4Editor-Testing.dll
Total build time: 8.81 seconds

I’ve had this problem too…

I was able to fix it by moving the following from the bottom of the Tuples.h file (starting at line 203) up in the file. I pasted this section at line 98 and it works.

template <typename FuncType, typename... Types>
auto TransformTuple(TTuple<Types...>&& Tuple, FuncType Func) -> decltype(TTransformTuple_Impl<TMakeIntegerSequence<uint32, sizeof...(Types)>>::Do(MoveTemp(Tuple), MoveTemp(Func)))
	return TTransformTuple_Impl<TMakeIntegerSequence<uint32, sizeof...(Types)>>::Do(MoveTemp(Tuple), MoveTemp(Func));

template <typename FuncType, typename... Types>
auto TransformTuple(const TTuple<Types...>& Tuple, FuncType Func) -> decltype(TTransformTuple_Impl<TMakeIntegerSequence<uint32, sizeof...(Types)>>::Do(Tuple, MoveTemp(Func)))
	return TTransformTuple_Impl<TMakeIntegerSequence<uint32, sizeof...(Types)>>::Do(Tuple, MoveTemp(Func));

Don’t know how this is not causing everyone to have problems with compiling…

Anyway, hope this helps