Concatenating FStrings

I am baffled by the FString::Format method. My desired goal is to concatenate three float values into an FString (separated by commas). Example: from 0.5f, 1.5f and 76.1f create "0.5,1.5,76.1".

For some reason concatenating FString is not allowed (FString::SanitizeFloat(0.5f) + FString(",") doesn't work) and I was unable to make the FString::Format method work (FString::Format(&FString("{0},"), 1.5f) throws bad arguments error).

I am aware of the Append function, but that seems very unoptimized when concatenating for example 5 strings.

What version are you currently using? Your snippet throws me the same compile time error as the first method that I’ve tried.

c:\program files (x86)\epic games\4.11\engine\source\runtime\core\public\Misc/OutputDevice.h(382): error C2665: 'CheckVA': none of the 11 overloads could convert all the argument types

Uh. That suggests the issue may be somewhere else, but that is rather odd considering that the game compiles when FString concatenations are removed.
Thanks for your effort, though.

I just tested FString Toto = FString::SanitizeFloat(0.5f) + FString("321");
and it compiles.

I’m using 4.12.

I just google this CheckVA weird thing. I suggest you look at this post How can I resolve the error: "'CheckVA' : none of the 11 overloads could convert all the argument types"? - Programming & Scripting - Epic Developer Community Forums

Are you using Visual Studio 2015 by the way ? Cause the post talks about C++11 which is not supported in old visual studio version.

I don’t think Epic Games actually re-developped their own C++ compiler. I think they use the Visual Studio one.

Switching to newer VS solved the issue, but that is strange since VS doesn’t have anything to do with the build process (only invokes UE programs that do the actuall build).