Passing a member function as template argument

The problem is that you are trying to use a pointer-to-member as a type template parameter, and this is not supported, basically because when you define a type you don't bind that type to any specific object.

When (as suggested in a comment) you make stringHash static, then you no longer need the object, so it can be used to define the type.

If you still need to have stringHash from a non-static member, then you can change the template to something like the below. Be aware that you have to pass the object to the HashTable in order to call the hashFunction. Also, keep an eye on the syntax to call it.

template<class KeyType, class Obj> using hashFunction_t =
    size_t(Obj::*)(size_t, const KeyType&);

template< class KeyType, class ValueType, int nHashGroups,
    class Obj, hashFunction_t<KeyType, Obj> hashFunction>
class HashTable
{
public:
    explicit HashTable(Obj& obj) : m_obj{obj} {
        (m_obj.*hashFunction)(10, ""); // arguments just for illustrative purposes
    }

private:
    Obj& m_obj; // keep a reference to the object to call the method
                // be careful with dangling references
};

class Entity
{
    size_t stringHash(size_t nGroups, const std::string& key)
    /* ... */

    // Pass a reference to the object
    HashTable <std::string, int, 10, Entity, &Entity::stringHash> ht{*this};
};