Can FMath::Clamp be used with FVector2D?

I noticed that when clamp was used with FVector2D, when one of the values of the test vector exceeds the maximum, the test value suddenly becomes immutable.

I have since fixed the problem in my code by applying clamp to the float values within the struct separately. My original code looked like this, with MousePosition and ScreenDimensions both FVector2D:

void UpdateMousePosition(FVector2D MouseInput)
{
    MousePosition = FMath::Clamp(MousePosition + MouseInput, -ScreenDimensions, ScreenDimensions);
}

I noticed that when I moused to the edge of the allowed dimensions, my mouse cursor became stuck at the edge.

FMath::Clamp is not component wise. its a template function, you don’t get compile error because < operator is implemented for FVector2D.

	static FORCEINLINE T Clamp( const T X, const T Min, const T Max )
	{
		return X<Min ? Min : X<Max ? X : Max;
	}

and thats why it made a bug for me. AFAIK there is no component wise Clamp for FVector2D you have to write it yourself. though there is a ::ClampVector for FVector.