title: Call function pointer using map
body: <p>I am begginer in C++ and
  I have the following template class:</p>
  <pre><code>template&lt;typename... extensions&gt;
  class SomeServiceProxy
  {
  public:
  void DoSomething() {std::cout&lt;&lt;&quot;\ndoing sth\n&quot;;};
  };
  </code></pre>
  <p>With the following pointer to function using &quot;using&quot; keyword</p>
  <pre><code>template&lt;typename... extensions&gt;
  using DoSomethingFnPtr = void (SomeServiceProxy&lt;extensions...&gt;::*)();
  </code></pre>
  <p>And I am trying to put the method in a map and call it:</p>
  <pre><code>std::map&lt;int, void*&gt; myMap;
  
  
  
  int main()
  {
  SomeServiceProxy&lt;int&gt; proxy;
  DoSomethingFnPtr&lt;int&gt; memfnptr = &amp;SomeServiceProxy&lt;int&gt;::DoSomething;
  proxy.DoSomething();
  (proxy.*memfnptr)(); //works
  myMap[0]= &amp;memfnptr;
  
  auto it=myMap.find(0);
  if(it != myMap.end() ){
  SomeServiceProxy&lt;int&gt; proxy2;
  (proxy2.&amp;(it-&gt;second))(); //error
  }
  
  
  
  std::cout&lt;&lt;endl;
  return 0;
  }
  </code></pre>
  <p>What I get is : error: expected unqualified-id before ‘&amp;’ token</p>
  <p>Q: Is there any way to call the method using the map?</p>