I have this code

```
class ClassX {};

class ClassY : public ClassX {};
typedef std::function<void (ClassX*)> myCaller;

class Foo {
    Foo()
    {
        createCaller(this, &Foo::bar); //line 22 with the error
    }

    template <typename Class>
    void createCaller(Class *obj, void (Class::*func)(ClassX*))
    {
         myCaller mc = std::bind(func, obj, std::placeholders::_1);;
    }

    void bar(ClassY* x)
    {
        printf("fooBrr");
    }

};

```

and it works fine till bar takes ClassY that extends ClassX instead of ClassX.

i get the compile time error:
main.cpp:22:9: No matching member function for call to 'createCaller'

The question is how would i go about allowing bar to take a parameter of any class that extends ClassX or any class at all? is it even possible?