title: Passing a callable that may change to an instance of a class
body: <p>I have a set of callables which I'd like to associate to instances of a particular class <em>Node</em>. Each instance of <em>Node</em> needs only hold one callable, and may call it from a member function. Suppose A, B, and C are callables, which may have different function signatures:</p>
  
  <pre><code>Node n1,n2,n3;
  n1.associate(A);
  n2.associate(B, 42);
  n3.associate(C, "foo");
  
  //...
  
  n1.mem_fn(); //will call A at some point inside some_other_fn()
  n2.mem_fn(); //will call B, passing 42 as argument
  
  //...
  
  n1.associate(C, "bar");
  n1.mem_fn(); //now C will replace A, and be called from n1::mem_fn() with arg "bar"
  </code></pre>
  
  <p>How can I accomplish this? The return type of the callables may be different.</p>