title: Templated function pointer to member function
body: <p>Hi all happy new year etc.</p>
  
  <p>I am having trouble with <em>templating</em> some function pointer : </p>
  
  <p>The code so far is as follows : </p>
  
  <pre><code>    template&lt;class T&gt;
      class EventMapper
      {
      private:
          typedef std::wstring const (T::*messageHandler)(std::wstring const &amp; myMessage);                //!&lt; Templated function pointer
          typedef std::tr1::unordered_map&lt;std::wstring, messageHandler&gt; umap;                             //!&lt; abbreviation for eventHandler map container
          typedef umap::const_iterator eventCIt;                                                          //!&lt; abbreviation for event map const_iterator
          typedef umap::iterator  eventIt;                                                                //!&lt; abbreviation for event map iterator
  
          //test func ptr
          T const &amp; myInstance;
          umap myEventMap;
          eventCIt myCurrentCommand;                                                                      //!&lt; current selected command
      public:
          EventMapper( T const &amp; instance_in) : myInstance(instance_in){}
  
          //register an event handler
          void registerHandler(std::wstring const &amp; cmd_in, messageHandler handler_in)
          {
              this-&gt;myEventMap.insert(umap::value_type(cmd_in, handler_in));
          }
  </code></pre>
  
  <p>I get this error under MSVS 2008 SP1 : </p>
  
  <pre><code>Error   3   error C2146: syntax error : missing ';' before identifier 'eventCIt'    o:\AX_FusRecAlg\include\Reconstruction\JobListEditor\Types.h    19  AX.Services.Reconstruction.JobListDataProviderTest
  </code></pre>
  
  <p>Not very descriptive. Is what I am trying to do even possible? Any tips would be welcome! Thanks.</p>