title: error: typedef name may not be a nested-name-specifier
body: <p>I am trying to do something along the lines of <a href="https://stackoverflow.com/questions/2135457/how-to-write-a-wrapper-over-functions-and-member-functions-that-executes-some-cod/2140112#2140112">this answer</a>, and struggling:</p>
  
  <p><code>
  $ gcc --version<br>
  gcc (GCC) 4.2.4 (Ubuntu 4.2.4-1ubuntu4)
  </code></p>
  
  <pre><code>file.cpp:7: error: template argument 1 is invalid  
  file.cpp:7: error: typedef name may not be a nested-name-specifier
  </code></pre>
  
  <p>And the offending part of the file:</p>
  
  <pre><code>template &lt;class R, class C, class T0=void, class T1=void, class T2=void&gt;
  struct MemberWrap;
  
  template &lt;class R, class C, class T0&gt;
  struct MemberWrap&lt;R, C, T0&gt;{
      typedef R (C::*member_t)(T0);
      typedef typename boost::add_reference&lt;typename T0&gt;::type&gt; TC0; // &lt;---- offending line
  
      MemberWrap(member_t f)
          : m_wrapped(f){
      }
  
      R operator()(C* p, TC0 p0){
          GILRelease guard;
          return (p-&gt;*(this-&gt;m_wrapped))(p0);
      }
  
      member_t m_wrapped;
  };
  </code></pre>