How to compare montage is same?

hi.

I want to make sure that the montage after the play is the same as what I have designated.

I tried this.

  1. PLAY MONTAGE

void ACSCharacter::onBeginDodge()
{
	doingDodge = true;
	if (ActionAnimationMontage.dodge != NULL)
	{
		GetMesh()->GetAnimInstance()->Montage_Play(ActionAnimationMontage.dodge, 1.0f);
		FOnMontageEnded MontageBlendOutDelegate;
		MontageBlendOutDelegate.BindUObject(this, &ACSCharacter::**onMontagePlayEnd**);
		GetMesh()->GetAnimInstance()->Montage_SetEndDelegate(MontageBlendOutDelegate, ActionAnimationMontage.dodge);
	}
}
  1. ATFER PLAY, CHECK LAST PLAYED MONTAGE

void ACSCharacter::onMontagePlayEnd(UAnimMontage* Montage, bool bInterrupted)
{
	if(Montage == ActionAnimationMontage.dodge)
	{
		onEndDogge();
	}
}

Of course this code doesn’t work.

I want to know how to determine whether the montage that I reproduced is the same as the specified montage.

I want to avoid comparisons by name whenever possible.

What doesn’t work?