Use HasMatchingGameplayTag

Hello deer community,

I need some help I would like to use the function HasMatchingGameplayTag of “IGameplayTagAssetInterface”, I tryed in blueprint, no problem.
I did my player in c++ and my problem actually is to use this function to check the Tag but, don’t know how and what element of the player I have to take and cast to call the function.

If someone have an idea or can explain me , would be nice.

PS: sorry for my english

THX

This is what i want to do in c++:

#include “GameplayTagAssetInterface.h”
#include “BlueprintGameplayTagLibrary.h”

            AYourClass::YourFunction(FGameplayTag BaseTag, UObject* NewObject,
            	FGameplayTag DefaultTag, const FGameplayTagContainer& NewTags)
            {
            	IGameplayTagAssetInterface* TempInterface = Cast<IGameplayTagAssetInterface>(NewObject);
            	if (TempInterface)
            	   {
            	      if(UBlueprintGameplayTagLibrary::IsGameplayTagValid(DefaultTag))
                      {
                         if (TempInterface->HasMatchingGameplayTag(BaseTag))
        		         {
        			            return true;    		
                         }
                     }
        	      }
        	return false;
           }