title: Calling member function from another member function's implementation
body: <p>So I'm defining a class <code>sqmatrix</code> of square matrices for fun and learning, and I've successfully defined a function <code>submat</code> that outputs a submatrix of the object constructed in a certain way:</p>
  
  <pre><code>sqmatrix sqmatrix::submat (unsigned int row, unsigned int col)
  { /* code */   return smat;    }
  </code></pre>
  
  <p>Now I want to define another function that takes the submatrix constructed by <code>submat</code> and outputs, say, the matrix where all elements have been multiplied by <code>42</code>. To do so, I wrote</p>
  
  <pre><code>sqmatrix sqmatrix::cofact (unsigned int srow, unsigned int scol)
  {
     sqmatrix cfac = 42 * m_mat.submat(srow, scol);
     return cfac;
  }
  </code></pre>
  
  <p>where I'd previously overloaded <code>*</code> to work with my objects, and <code>m_mat</code> has been declared in the header of the class as a <code>vector</code> of <code>vector</code>s containing <code>long long int</code>s. However, this did not compile, so I went for member function pointers and wrote:</p>
  
  <pre><code>sqmatrix sqmatrix::cofact (unsigned int srow, unsigned int scol)
  {
     sqmatrix (sqmatrix::*point)(unsigned int, unsigned int);
     point = &amp;sqmatrix::submat;
     sqmatrix cfac = 42 * (m_mat.*point)(srow, scol);
     return cfac;
  }
  </code></pre>
  
  <p>However, this does not compile either. Here are the relevant lines in the header file:</p>
  
  <pre><code>private:
   // ...
   std::vector&lt; std::vector&lt;long long int&gt; &gt; m_mat;
  public:
   // ...
   sqmatrix submat(unsigned int row, unsigned int col);
   sqmatrix cofact(unsigned int srow, unsigned int scol);
  </code></pre>
  
  <p>Compiler says: </p>
  
  <blockquote>
    <p>Error: pointer to member type <code>sqmatrix (sqmatrix::)(unsigned int,unsigned int)</code> incompatible with object type <code>std::vector&lt; std::vector&lt;long long int&gt; &gt;</code> </p>
  </blockquote>
  
  <p>What am I getting wrong?</p>