Function Templates - Inserting T.MemberFunction()?

I have a system for structs that simulate dictionaries, and implement their access with

  • Entrydatatype GetEntry()
  • Keydatatype GetKey()

Atm, I have two template functions:

  • Dictionary_GetValues_Entry()
  • Dictionary_GetValues_Key().

I would like to make this only one function, and allow the user to specify, as an input parameter, the function that the function will use so that calling the function would look something like

Dictionary_GetValues<FStruct, EntrydataType>(Array, GetEntry());   

My current function looks like this

 template <class T, class U>
    static TArray<U> Dictionary_GetValues_Entry(const TArray<T>& Array)
    {
        if (!Array.Num()) return {};
        TArray<U> Temp;
        for (int32 X = 0; X < Array.Num(); X++)        { Temp.Add(Array[X].GetEntry()); } //Replace the .GetEntry() here for an input parameter
        return Temp;
    }

Does anyone here know how this could be approachable? So that in the template, when adding, it looks something like this:

{ Temp.Add(Array[X].InputParameter); }

As in, calling the function from the Array even though it’s specified as an input parameter.