RealDocs

TArray::ToString

function Core Since 4.25
#include "Containers/Array.h"
Access: public Specifiers: const

Description

Converts the frozen memory image representation of this TArray to a human-readable string by delegating to the allocator's ToString. Part of the shader freeze/unfreeze diagnostic system.

Caveats & Gotchas

  • This method only produces output when the element type has a type layout and the allocator supports freeze memory image. Otherwise it is a compile-time no-op (constexpr branch not taken) and OutContext receives no data.
  • This is not equivalent to a general-purpose FString conversion of the array contents. It reflects the frozen binary layout used by the shader compiler, not the logical element values. Do not use it to debug normal gameplay arrays.

Signature

void ToString(const FPlatformTypeLayoutParameters& LayoutParams, FMemoryToStringContext& OutContext) const

Parameters

Name Type Description Default
LayoutParams const FPlatformTypeLayoutParameters& Platform-specific type layout parameters used to interpret the frozen memory layout.
OutContext FMemoryToStringContext& The context that accumulates the human-readable string representation of the frozen array.

Return Type

void

Example

Context: used by engine freeze diagnostics tooling C++
// Not used directly in gameplay code.
// The engine calls this when dumping frozen memory layouts for shader debugging:
FMemoryToStringContext StrContext;
MyFrozenArray.ToString(PlatformParams, StrContext);
UE_LOG(LogShaders, Log, TEXT("%s"), *StrContext.ToString());

Version History

Introduced in: 4.25

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.