title: getting a must have (pointer-to) function type on a variable that is defined as a (pointer-to) function type
body: <p>I am creating a typedef for a function that will be used to call arbitrary functions that are stored in a string to function pointer map. I am sure that the problem has something to do with how the type is declared and referenced through many objects in my code but the is the only way I can think of how to do what I need to</p>
  
  <p>This is fmap.h here i declare the fmap class and the executefunctions class, the typedef for the function pointer is the on the first line of the public members for fmap</p>
  
  <pre><code>class Web;
  class Matlab;
  class Word;
  class Node;
  
  class ExecFunctions
  {
  public:
      ExecFunctions(){}
      /**
      Function:       travel
      */
      int travel(Web *concepts, Matlab *mat, Word * words, int reqIdx, string theWord, vector&lt;string&gt; *dependsMet);
  
  };
  
  class FMap
  {
  public:
      typedef int (ExecFunctions::*ExecFunc)(Web *, Matlab *, Word *, int, string, vector&lt;string&gt; *);
      ExecFunc getFunc(string funcName){
          return theFuncMap.descrToFuncMap[funcName];
      }
  
  private:
      class FuncMap {
      public:
          FuncMap() {
                  descrToFuncMap["travel"] = &amp;ExecFunctions::travel;  
          }
          std::map&lt;std::string, ExecFunc&gt; descrToFuncMap;
      };    
  };
  
  
  
  #endif
  </code></pre>
  
  <p>next is web.h I am only including what I think are the relevant parts</p>
  
  <pre><code>#include "fmap.h"
  
  class Node
  {
      private:
          ....
          //pointer to execcution function
          FMap::ExecFunc func;
          //fmap function used to access execution function pointers
          FMap *functionMap;
              .....    
  public:
            FMap::ExecFunc getExecFunc();
  };
  </code></pre>
  
  <p>now what I think is the relavent part of web.cpp</p>
  
  <pre><code>Node::Node(string name, Node *nodeParent)
  {
      attrList = new Attr();
      nodeName = name;
          ........
      func = functionMap-&gt;getFunc(name);
  }
  </code></pre>
  
  <p>Now finally. This is where I am getting the error. There are three lines of comments before the error line explaining the error I am getting.</p>
  
  <pre><code>void process(Util myUtil, Web *concepts, Matlab *mat, string path)
  {
      int funcP
      bool dependsProcessed = false;
      vector&lt;string&gt; *dependsDone = new vector&lt;string&gt;();
      FMap::ExecFunc funcToCall;
  
      funcToCall = realMeanings[i][j]-&gt;getConcept()-&gt;getExecFunc();
  
  
  //the line bellow this comment is where I'm getting the error. Visual Studio says
  //that funcToCall must have (pointer-to) function type, and then the VS compiler says
  //diabot.cpp(177): error C2064: term does not evaluate to a function taking 6 arguments
      funcPtrRet = funcToCall(concepts, mat, realMeanings[i][j], reqConceptsIdx[i][j], queryWords[i], dependsDone);
  
      return;
  }
  </code></pre>
  
  <p>any help anyone can give would be greatly appreciated.</p>
  
  <p>Thank you all in advance</p>