Hi, I was testing the same thing and it looks like unfortunately we can’t have constexpr FString
because FString
is not a literal type.
Other working alternatives:
//Works as global FString for example for function inputs, but is not evaluated at compile time as constexpr
const FString G_AUTOSAVE_SLOT_NAME = "Autosave";
//Evaluated at compile time, but in some cases where TCHAR* is not accepted you will need to wrap it with FString, like FString(G_AUTOSAVE_SLOT_NAME)
constexpr const TCHAR* G_AUTOSAVE_SLOT_NAME = TEXT("Autosave");