title: Is it possible to call std::invoke such that it can work with function pointer?
body: <p>If I have a class <code>Entity</code> and it has a getter function named <code>entityGetter</code> and a setter function <code>entitySetter</code> </p>
  
  <p>and I wanted to apply a member function to an <code>Entity</code> object, parameterized by <code>value</code> I would do something like this</p>
  
  <pre><code>Entity e;
  std::invoke(&amp;Entity::entitySetter, e, someValue);
  </code></pre>
  
  <p>The idea would be equivalent to</p>
  
  <pre><code>    e.entitySetter(someValue);
  </code></pre>
  
  <hr>
  
  <p>What I want to do is make a function that further generalizes it into something like this</p>
  
  <pre><code>void addHelper (  int value
                  , Entity&amp; e
                  , std::function&lt;int (Entity&amp;)&gt; getFunc
                  , std::function&lt;void (Entity&amp;, int)&gt; setFunc
                  ) {
  
    std::invoke(setFunc, e, getFunc_(value)); 
  
  // getFunc_ returns an int. Just a wrapper around e.getFunc () * value
  </code></pre>
  
  <p>which when called somewhere with </p>
  
  <ol>
  <li><p>a value, </p></li>
  <li><p>an <code>Entity</code> object reference, </p></li>
  <li><p>a getter function <code>getFunc</code> wrapped in a lambda function and </p></li>
  <li><p>a setter function <code>setFunc</code> also wrapped in a lambda function</p></li>
  </ol>
  
  <p>would call <code>getFunc_</code> on the object <code>e</code>, and use that value to set it in <code>e</code>.</p>
  
  <p>The problem is I don't have enough experience in C++ to figure out why the above example does not work.</p>