#include <functional>

using FPTR = std::function<int(int)>;

class A {
public:
  FPTR worker;
  int i;
  A(int x) { i = x; }
};

template <class BASE>
class C : public BASE {
public:
  C(int y) : BASE(y) {
    this->worker = std::bind(&C<BASE>::doit, this, y);
  }
  int doit(int z) { return this->i + z; }
  int doit_different(int z) { return this->i - z; }
};

int main() {
  C<A> instance(66);
  instance.worker(5);
  return 0;
}